What problem does it solve?
It solves the problem of inconsistent, hard-to-debug error handling in Nuxt apps by providing a centralized approach for translating API failures into typed errors, predictable handlers, and clean user feedback.
Core Features & Use Cases
- Typed error classes for common HTTP outcomes: Use errors like
ValidationError (422), ConflictError (409), and TooManyRequestsError (429) to preserve structured details and enable targeted UI behavior.
- Configurable global error handlers: Route specific status codes to redirects, flashes, or rejected typed errors to keep behavior consistent across the app.
- Action-level error standardization: Wrap mutation/action failures with
useHandleActionError so user messages are consistent and error details are handled appropriately.
- Validation-to-form mapping: Convert backend validation payloads into form-field error objects (e.g., mapping
errors into FormError[]) for direct display in form components.
- Response interceptor for fetch errors: Centralize fetch/response error handling via an interceptor so error processing happens automatically.
Quick Start
Use the 0105-nuxt-errors skill to implement Nuxt error handling by adding typed error classes, configuring errorHandlers for key status codes, and wiring a response error interceptor for consistent API error behavior.