Use when you need to apply functional exception handling best practices in Java — including replacing exception overuse with Optional and VAVR Either types, designing error type hierarchies using sealed classes and enums, implementing monadic error composition pipelines, establishing functional control flow patterns, and reserving exceptions only for truly exceptional system-level failures. Part of the skills-for-java project
76
70%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./skills/143-java-functional-exception-handling/SKILL.mdIdentify 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 improvementsFor detailed guidance, examples, and constraints, see references/143-java-functional-exception-handling.md.
7772a1b
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.