2 ms·
I rarely observe developers investing in forcing the error conditions that they’re supposedly handling. Without that mechanism, your error “handling” might be
by makecheck 8y ago
I rarely observe developers investing in forcing the error conditions that they’re supposedly handling. Without that mechanism, your error “handling” might be code that looks good and does nothing (or worse, the wrong thing).
For example, in this case: the claim that error handling is “centralized”...how can you be sure? It is generally trivial to locally ignore or capture errors that may not propagate even if they should. Dependencies may not be well-behaved. If you cannot force (or fake) key conditions that “should” cause a component to fail, you don’t really know how that error affects the system or if it can even be seen by the “centralized” handler. One of the issues with exception handling is that programmers may think synthesizing each exception “tests” the condition, when you may not even be able to prove that the real error will lead to the expected exception. You have to be able to simulate or force the bad behaviors themselves, independent from your exception hierarchy.
I’m also skeptical that having local error code “disappear” is a net win. When debugging, you’d probably have to add it all back to know how the heck an error might have originated from that local code. At the very least, local code to reveal errors should never go away.