SuppressedException extends RuntimeException { public static Throwable from(Throwable throwable) { String message = String.format("%s [%s] occurred while processing thread (%s)", highLevelType(throwable), throwable, Thread.currentThread().getName()); SuppressedException suppressedException = new SuppressedException(message); suppressedException.setStackTrace(throwable.getStackTrace()); return suppressedException; } SuppressedException(String message); static Throwable from(Throwable throwable); @Override synchronized Throwable fillInStackTrace(); @Override String toString();  }
@Test public void throwableSuppressingItselfShouldBeLoggable() { Throwable throwable = new Throwable("a exception"); throwable.addSuppressed(SuppressedException.from(throwable)); log.error("Error", throwable); }