We have received Java code from a software supplier. It contains a lot of try-catch
blocks with nothing in the catch
part. They\'re all over the pl
It's not the best:
It hides evidence of the exception so debugging is harder
It may cause features to fail silently
It suggests that the author might actually have wanted to handle the exception but never got around to it
So, there may be cases where this is OK, such as an exception that really is of no consequence (the case that comes to mind is Python's mkdirs
, which throws an exception if the directory already exists), but usually, it's not so great.