What problem does it solve?
This Skill eliminates inconsistent error handling, repetitive try/except blocks in Litestar route handlers, and non-compliant error responses that fail to follow RFC 9457 or project-specific error contracts.
Core Features & Use Cases
- Centralized Exception Translation: Map domain exceptions to consistent HTTP status codes and payloads via global handlers, removing redundant error handling code from individual routes.
- RFC 9457 Compliant Responses: Ensure all API error responses follow standard Problem Details semantics for predictable client behavior.
- Stable Error Contracts: Define a project-wide exception hierarchy that services can rely on for consistent error signaling.
- Use Case: For a Litestar e-commerce API, use this Skill to define a ConflictError for duplicate order submissions, register a global handler, and ensure all order-related errors return uniform 409 responses without repeating error handling logic in every route handler.
Quick Start
Use the litestar-exceptions skill to define a custom ApplicationError base exception class, register global exception handlers in your Litestar app configuration, and map domain-specific errors like NotFoundError to consistent HTTP 404 responses across all your API endpoints.