Why this matters
Ensures failures are observed and mapped to consistent outcomes.
Attach exceptionally/handle to CompletableFuture chains; never assume success.
Ensures failures are observed and mapped to consistent outcomes.
Side-by-side examples engineers can pattern-match during review.
CompletableFuture<String> f = fetch(); return f.join();return fetch()
.thenApply(this::ok)
.exceptionally(e -> error("fetch failed"));future.thenApply(...); // no error pathfuture.handle((v,e) -> e==null?ok(v):error())From the same buckets as this rule.