(no title)
rmoskal | 8 years ago
You raise important issues.
I would say, when you can, rewrite your code so you don't have to worry about such things.
Roll back everything under your control in the event of an error, and if there are side effects beyond your control isolate them at the end of the composition.
If two functions return the same exception, you can always wrap one of them so it returns a different one.
If a function needs it's own stand alone exception handling, do it in there.
If it really is necessary to know one could introduce some sort of monadic error handling that wraps up the results of all the functions including their place in the composition.
But really I would try to rewrite my code so that I wouldn't have to do that.
No comments yet.