Pass the error to the handler.

If we have an error handler, inject the error into the payload so the handler
has access to it.