|
|
|
|
|
by lolinder
1864 days ago
|
|
Can you please elaborate how the pattern that you describe doesn't pass the buck to a portion of code that has less context for the cause of the failure? > You can write code as if every function call is successful How does writing code as if every function call is successful (when you know that some functions will fail) not lead to some other bit of code further up the call stack having to make a decision about an exception that it doesn't have the context for? A bit of code which probably was written by a different developer who didn't anticipate what you were going to do? |
|
There have been frameworks like the Common Lisp Condition System to let a caller dictate a recovery/retry policy, but they never caught on. In practice "do no harm, give up, and report the error" is what almost everyone wanted, and most languages support it without punitive effort.