void (Consumer<? super AtomicReference<Throwable>> runnable) { AtomicReference<Throwable> loggedError = new AtomicReference<>(); LoggedErrorProcessor.executeWith(new LoggedErrorProcessor() { @Override public @NotNull Set<Action> processError(@NotNull String category, @NotNull String message, String @NotNull [] details, @Nullable Throwable t) { assertNotNull(t); loggedError.set(t); return Action.NONE; } }, ()->runnable.accept(loggedError)); }