void () { watchLoggedExceptions(loggedError -> { // unchecked is rethrown assertThrows(UnsupportedOperationException.class, () -> ReadAction.nonBlocking(() -> { throw new UnsupportedOperationException(); }).executeSynchronously()); assertNull(loggedError.get()); // checked is wrapped assertThrows(ExecutionException.class, () -> ReadAction.nonBlocking(() -> { throw new IOException(); }).executeSynchronously()); assertNull(loggedError.get()); }); }