{"repo":"ghazi-git/drf-standardized-errors","free":true,"listed":false,"github":"https://github.com/ghazi-git/drf-standardized-errors","clone":"git clone https://github.com/ghazi-git/drf-standardized-errors.git","description":"Standardize your DRF API error responses","language":"Python","stars":347,"topics":["django-rest-framework","standardized-errors","api","error-formatter","error-response","exception-handling","django","python"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"DRF Standardized Errors Standardize your DRF API error responses. By default, the package will convert all API error responses (4xx and 5xx) to the following standardized format: Features - Highly customizable: gives you flexibility to define your own standardized error responses and override specific aspects the exception handling process without having to rewrite everything. - Supports nested serializers and ListSerializer errors - Plays nicely with error monitoring tools (like Sentry, ...) Requirements - python = 3.8 - Django = 3.2 - DRF = 3.12 Quickstart Install with pip Add drf-standardized-errors to your installed apps Register the exception handler Notes - This package is a DRF exception handler, so it standardizes errors that reach a DRF API view. That means it cannot handle errors that happen at the middleware level for example. To handle those as well, you can customize the necessary django error views. You can find more about that in this issue. - Standardized error responses when DEBUG=True for unhandled exceptions are disabled by default. That is to allow you to get more information out of the traceback. You can enable standardized errors instead with: Integration with DRF spectacular If you plan to use drf-spectacular to generate an OpenAPI 3 schema, install with pip install drf-standardized-errors[openapi] . After that, check the doc page for configuring the integration. Links - Documentation: https://drf-standardized-errors.readthedocs.io/en/latest/ - Changelo","default_branch":null,"files":null,"tree":[],"storefront":"/r/ghazi-git","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ghazi-git/drf-standardized-errors/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}