When a catch
clause is empty, it essentially ignores any occurrences of the particular exception it handles. This could allow critical bugs to go undiagnosed because any relevant exceptions indicative of a bug would be discarded within this catch
block.
try {
// ...
} catch(Exception e) {
// Nothing here
}
Consider at least logging the exception to ensure that issues that may actually be bugs are not missed.
try {
// ...
} catch(Exception e) {
System.err.println(e.message); // It may be better to make use of a more robust logging solution like logback.
}