void (String[] args) { Throwable error = null; try { doSomething(); } catch (AssertionError e) { // rethrow error throw e; } catch (Throwable e) { // remember error error = e; } if (error != null) { // <<--- inspection warning // handle error ... } }