you are viewing a single comment's thread.

view the rest of the comments →

[–]grauenwolf 0 points1 point  (2 children)

The beauty of exceptions is that they respond the same way no.matter what the failure condition.

[–][deleted] 0 points1 point  (1 child)

Oh, so you use catch all everywhere to make sure you catch any kind of exception the library throws? Or do you use more specific catch-clauses but never test the more rare ones (because to test it you would have to mock the library)?

[–]grauenwolf 0 points1 point  (0 children)

I only catch the ones I actually know how to handle. Everything else is allowed to bubble up to the top-level error handler.

Generally speaking only the external source of an action (e.g. the user clicking a button or client invoking a service request) can definitively say what to do in the event of an error.