News for hackers. Stuff that matters.
Re:Elegant Error Handling with the JavaScript “Either” Monad by dropofwill on Wednesday June 19, 2019 @08:35AM (#20222701)
It depends on how it is used. I’ve definitely seen it used like a goto mechanism (on the JVM, i don’t write much JS), e.g. throw x in y to skip these business logic steps in z, and that makes my head hurt.

Personally I just try not to throw exceptions when compensation/recovery is expected. If something should be handled by the caller put it in the return type, if it’s really fatal give up and log a stack trace.

There are no comments on this comment yet.