Empty Catch Block (ARCH4150)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
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.
Incorrect
Section titled “Incorrect”try { config.load(path);} catch (IOException e) { // ignore}Correct
Section titled “Correct”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.