How to handle uncaught exceptions from CompletableFuture.runAsync
问题 Our application has some code that runs asynchronously that is failing. Like this: CompletableFuture.runAsync( () -> { throw new RuntimeException("bad"); }, executorService ); We want default exception handling code that can catch these errors, in case specific uses forget to handle exceptions (this came from a production bug). This is apparently tricky. The answer given in Handling exceptions from Java ExecutorService tasks does not work. It relies on the task being a Future<?> and then