calipso icon indicating copy to clipboard operation
calipso copied to clipboard

err strategy

Open laurelnaiad opened this issue 11 years ago • 2 comments

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?

laurelnaiad avatar Sep 29 '13 00:09 laurelnaiad

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 .

richtera avatar Sep 29 '13 13:09 richtera

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?

laurelnaiad avatar Sep 29 '13 15:09 laurelnaiad