New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why does seneca override eraro ? / Error management proposal #579
Comments
I actually do these things as a wrapper for all of our internal seneca usage, but it would be cool to have it in seneca proper. Basically what I do is, I have a |
Hi @jeromevalentin error management is a big topic. It's not consistent and need a rewrite. Follow this issue for the best results #398 |
Yes lots of work to do here - and indeed the current system needs to at least be documented. A further complication to note is that messages may be transported over the network to non-JS systems, so simply passing a JS Exception directly is not feasible either. |
FYI starting some work on this: https://github.com/rjrodger/seneca/blob/master/test/error.test.js#L60 |
Hi @rjrodger if you have time you could check my error handling in hemera. I use https://github.com/busbud/super-error to create custom errors and for preserving the error chain.
|
In seneca 3.2.1, when an error is thrown during an act call, it is correctly handled and forwarded to caller.
But the exception is being wrapped in a seneca eraro 'act_execute' error which is not useful for the caller!
I tried to use eraro directly (as it match my need to send internationalizable error code (plus details) to remote caller).
Unfortunately, seneca is also overriding eraro errors!! see: seneca.js line:43
So as a first quick step, would it be possible to change the override: true to false? or make it customizable?
Concerning error management, the version 3 helps a lot by catching thrown error in act automatically.
But from my point of view, seneca should not log, not wrapping such business error it as it is part of the service signature. Globally, there are two kind of errors:
Regards and thanks for the job guys, this library rocks ;)
Jérôme
The text was updated successfully, but these errors were encountered: