Java Exception Design

Exceptions as API design in Java: checked versus unchecked as a deliberate decision, hierarchy sizing, translation at layer boundaries with cause preservation, typed failure facts for retry policy, failure atomicity when a method throws partway through, and when a sealed result type beats an exception. Use when designing the exception surface of a service or library, when a catch block swallows a failure or rewraps one without its cause, when a codebase has dozens of exception types nobody catches separately, or when retry logic parses exception messages. Does not cover input validation at trust boundaries (java-defensive-programming) or precondition and postcondition semantics (java-design-by-contract).

robsonkades 62bd910 5 files · 32.2 KB Updated

File contents

robsonkades/agent-skills/tree/main/skills/java-exception-design commit 62bd910802

Frequently asked questions

npx skillmds@latest add robsonkades/java-exception-design