Universal error handler. If onError is provided — calls it and suppresses the exception. If onError is not provided — rethrows the exception.
Optional
Universal error handler. If onError is provided — calls it and suppresses the exception. If onError is not provided — rethrows the exception.