4 ms·
> when an exception isn't caught Not catching all exceptions is a glaring P0 bug.
by dboreham 4y ago
> when an exception isn't caught
Not catching all exceptions is a glaring P0 bug.
- funcDropShadow 4y agoYou should almost never catch all exceptions, i.e. Throwable on the JVM. That is one of the few things that Scala really got right. The `catch NonFatal(e) =>` idiom is doing that nicely. It will catch all throwables with a selected set of special cases, e.g. OutOfMemoryException and all the other VirtulMachineErrors. Catching those in a framework lead to extending the time until a crash follows on a serious issue. Crashing early is often beneficial in such a situation. Together with a process watchdog, like systemd, kubernetes, dockerd, whatever crashing early increases the uptime.