3 ms·
For that to work, you need to enumerate either the acceptable failures (network timeouts) or the unacceptable failures (logic error). However, for idempotent a
by seabee 12y ago
For that to work, you need to enumerate either the acceptable failures (network timeouts) or the unacceptable failures (logic error).
However, for idempotent actions, why does it matter what caused the exception? The worst that happens is you waste 3x the resources, and the benefit is you avoid false negatives from overspecifying your unacceptable failures.
- ajuc 12y agoIn java there's this distinction between Error (sth that's usualy non-recoverable), checked exception, and runtime exception. You would usually only catch runtime exceptions here if this was java (checked are checked staticaly, so they need to be caught anyway). So yeah, catching throwable is wrong usually.
- marcosdumay 12y agoIt's running on the Java VM, so I guess catching the exception created by the user pressing CTRL-C is very bad. It's also bad to catch the one created by Runnable.interrupt.