This shows you why should never ignore any exception unless you are 100% sure it will not occur. In that case, you should document WHY it will not occur; not only for other programmers to read, but also for yourself months later.

In any case where the exception might (or will) occur, at least print its stack trace.

Originally posted by Rob Prime: This shows you why should never ignore any exception unless you are 100% sure it will not occur. In that case, you should document WHY it will not occur; not only for other programmers to read, but also for yourself months later.

At work, we even don't ignore those exceptions. We "document" them by throwing an UnreachableCodeReachedException (which is a runtime exception), and sign it with our initials:

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus