Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Applies functional error handling in Java with Optional, VAVR Either, CompletableFuture, and sealed error types, curbing exception overuse.
Use this skill ↓68% 77%+9 ptsof test cases passed
Passed 17 of 22 test cases with the skill, and 15 of 22 without it.
3 of 3 safety checks passed
Not used yet
Identify and apply functional exception handling best practices in Java to improve error clarity, maintainability, and performance by eliminating exception overuse in favour of monadic error types.
What is covered in this Skill?
Optional<T> for nullable values over throwing NullPointerException or NotFoundExceptionEither<L,R> for predictable business-logic failuresCompletableFuture<T> for async error handlingflatMap/map/peek/peekLeft for chaining operations that can failScope: The reference is organized by examples (good/bad code patterns) for each core area. Apply recommendations based on applicable examples.
Before applying any functional exception handling changes, ensure the project validates. When introducing Either types, confirm the VAVR dependency (io.vavr:vavr) and SLF4J are present.
./mvnw validate or mvn validate before applying any changesEither types, confirm VAVR (io.vavr:vavr) and SLF4J are present./mvnw clean verify or mvn clean verify after applying improvementsSkills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.