First-Chance Exceptions
Sloppy code might be swallowing exceptions improperly without decent handling. When you see source code that looks like this, you should start to shiver:
try { // Exception raised here.}catch (SomeException) { }
At the same time, consider yourself lucky you saw the code to begin with. Much more likely you’re finding yourself back in a situation where you need to find out why the program misbehaves under certain circumstances. Assuming the preceding code lies at the heart of the observed misbehavior, the question becomes how to track it down. After all, the exception might long have been swallowed, and the program may crash in some different corner. Consider the following example:
This example is simple enough to spot ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access