Unhandled Promise Rejection (ARCH4031)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key java.async.missing-future-exceptionally · Severity warning · Category async
When a future chain is left without a rejection handler (exceptionally/handle), a thrown exception becomes an unhandled rejection that is silently swallowed.
Incorrect
Section titled “Incorrect”fetchUser(id) .thenApply(this::render) .thenAccept(this::send); // no rejection handlerCorrect
Section titled “Correct”fetchUser(id) .thenApply(this::render) .thenAccept(this::send) .exceptionally(ex -> { log.error("failed to process user", ex); return null; });Attach an exceptionally or handle stage to the future chain to log or compensate for rejections.