3 ms·
If you ignore (as in fail to handle) an exception, your software dies safely, it won't do the wrong thing. If you ignore or misuse error code, you carry on in
by masklinn 7y ago
If you ignore (as in fail to handle) an exception, your software dies safely, it won't do the wrong thing.
If you ignore or misuse error code, you carry on in a corrupted state.
- icedchai 7y agoHave you seen old java code that has tons of empty try / catch blocks? It is very, very common.
- lolc 7y agoJava is special in this regard because the common case of letting an exception terminate the program is harder than ignoring it. When I was still writing Java, I'd gotten so annoyed by this that in the top layers every method "throws Exception". It was less verbose than promoting all the checked exceptions to runtime errors. Unfortunately people don't know about this possibility and write empty catch statements because "it's not going to happen anyway". Yeah right.