litestar-exception-handling
Installation
SKILL.md
Exception Handling
Execution Workflow
- Separate startup and configuration failures from request-time failures.
- Decide whether the failure should be represented by raising
HTTPExceptionor by mapping another exception type through an exception handler. - Choose the narrowest layer that should own the handler: app, router, controller, or route handler.
- Keep the outbound error contract stable: status code, payload shape, media type, and safe detail level.
- Register app-level handlers for
404 Not Foundand405 Method Not Allowedwhen those responses must be customized. - Verify validation and server-failure paths separately so sensitive details do not leak unintentionally.