calipso
calipso copied to clipboard
err strategy
I'm trying to understand the strategy around error handling. Is there a document I missed?
I see cases where errors are thrown and where errors are logged and passed to next.
is it safe to say that one should throw errors that will be fatal anyway and pass them to next if there's hope that the process can otherwise functionally survive?
Good discussion to have. My thoughts on this
Errors should usually be logged unless they are expected. For example when the user closes the page mid response there is no reason the put that in the log.
Errors should not be shown to the user unless they are meaningful. Especially if they might reveal something.
Errors need to be thrown or passed on if they prevent further work to be done.
Andy
Sent from my iPhone
On Sep 28, 2013, at 8:42 PM, Stu Salsbury [email protected] wrote:
I'm trying to understand the strategy around error handling. Is there a document I missed?
I see cases where errors are thrown and where errors are logged and passed to next.
is it safe to say that
— Reply to this email directly or view it on GitHubhttps://github.com/cliftonc/calipso/issues/235 .
Errors need to be thrown or passed on if they prevent further work to be done.
I guess that's why I'm asking -- when I've passed err's to next in calipso it doesn't seem to stop a later error from occurring -- as if no error handler snapped up the error. That's why I looked around and ended up finding cases where errors are thrown instead (which I assume are crashing the process).
If the error is should be fatal, is that the way to create a fatal error? And otherwise log as appropriate and pass to next?