Skip to content

Empty Catch Block (ARCH4150)

Key java.logging.empty-catch-block · Severity error · Category logging

A catch block with an empty body (or only comments) silently swallows the exception. The problem is hidden, debugging becomes impossible, and the application may keep running in an inconsistent state.

try {
config.load(path);
} catch (IOException e) {
// ignore
}
try {
config.load(path);
} catch (IOException e) {
log.error("Failed to load config: {}", path, e);
throw new ConfigException(path, e);
}

At minimum log the exception, or rethrow it as a meaningful exception; never swallow it silently.