feat(api): implement centralized exception handling for unified error responses
- Add custom_exception_handler to handle exceptions in a unified format - Log errors with request context and provide debug information in development mode - Update settings.py to use the new exception handler - Export custom_exception_handler in __init__.py for accessibility This enhances error management across the API, improving debugging and user experience.
This commit is contained in:
@@ -204,6 +204,7 @@ REST_FRAMEWORK = {
|
||||
'igny8_core.api.authentication.CSRFExemptSessionAuthentication', # Session auth without CSRF for API
|
||||
'rest_framework.authentication.BasicAuthentication', # Enable basic auth as fallback
|
||||
],
|
||||
'EXCEPTION_HANDLER': 'igny8_core.api.exception_handlers.custom_exception_handler', # Unified error format
|
||||
}
|
||||
|
||||
# CORS Configuration
|
||||
|
||||
Reference in New Issue
Block a user