3 ms·
This! I'd like to think exceptions are reasonable as a terminal state for a particular user workflow, which sometimes even end up having the program terminated.
by tzhenghao 4y ago
This! I'd like to think exceptions are reasonable as a terminal state for a particular user workflow, which sometimes even end up having the program terminated. Examples include "unexpected I/O, corrupt files etc."
Exceptions should never be used if the control flow has means to recovery. For example, if-else statements with more different, downstream instructions.
- 9dev 4y agoWhat about, say, a webhook server that must call User-provided webhooks, and retry them on failures, or handle maximum request duration? I’d argue throwing well-nested exceptions, catching them and retrying is the most elegant solution to this problem there is.