However, the errorHandlerMiddleware catches all errors, meaning the Transit layer will always resolve true for the event messageHandler. Even if you define a global error handler and throw an error, this would still be caught at the bottom of this function.
I suggest we either allow event handlers to throw errors now PR 984 has been merged, or we make the ability to throw errors in event handlers configurable.
I can get around this issue by overriding the error-handler middleware and removing the final catch, but i think this should be solved inside the framework.
I recently made a pull-request to handle proper propagation of whether or not the event was handled successfully to the Transporter. https://github.com/moleculerjs/moleculer/pull/984
However, the errorHandlerMiddleware catches all errors, meaning the Transit layer will always resolve true for the event
messageHandler
. Even if you define a global error handler and throw an error, this would still be caught at the bottom of this function.I suggest we either allow event handlers to throw errors now PR 984 has been merged, or we make the ability to throw errors in event handlers configurable.