What problem does it solve?
This Skill addresses inconsistencies in error reporting, silent failures, and the exposure of sensitive details like stack traces in API responses, ensuring a more robust and user-friendly error management system.
Core Features & Use Cases
- Standardized HTTP Exceptions: Ensures all errors are returned with consistent HTTP status codes and user-friendly messages.
- Systematic Logging: Implements logging for all caught exceptions, providing crucial context for debugging.
- Custom Exception Hierarchy: Defines a clear structure for application-specific exceptions (e.g.,
NotFoundException, PermissionDeniedException).
- Use Case: When a user attempts to access a resource they don't have permission for, the API will consistently return a
403 Forbidden error with a clear message like "Permission denied: cannot delete user" instead of a generic error or a stack trace.
Quick Start
Implement the standard error handling structure by raising HTTPException with appropriate status codes and detailed messages.