Hacker News new | ask | show | jobs
by chrisdsaldivar 1890 days ago
Can you provide some more details wrt issues with error handling?
1 comments

Not the parent poster, but I'll tell you some of the pain points I've experienced:

* Async operations destroy stack information.

* It's very easy for someone to miss an error handler and end up with your process in an ugly state.

* Default error handling is "crash the process", no matter what else is going on.

* Lots of libraries that rely on buggy native code.

All of these, plus not being guaranteed that an error will actually be thrown to be caught rather than just hanging the process. In our case, we have a variety of tasks to carry out repeatedly on a set of entities, and the only reliable way we found to do it was to spawn new processes per task per entity. Reliable recovery from errors is basically impossible in long-running processes; you need to rely on idemptotent tasks and short-lived processes that are actively reaped if they take too long (in part this is also a consequence of the single-threaded execution model for JavaScript entailing co-operative multi-tasking).