File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ Standardize your [DRF](https://www.django-rest-framework.org/) API error respons
99[ ![ PyPI - License] ( https://img.shields.io/pypi/l/drf-standardized-errors )] ( https://github.com/ghazi-git/drf-standardized-errors/blob/main/LICENSE )
1010[ ![ Code style: black] ( https://img.shields.io/badge/code%20style-black-000000.svg )] ( https://github.com/psf/black )
1111
12- By default, the package will convert all API error responses (4xx and 5xx) to a standardized format:
12+ By default, the package will convert all API error responses (4xx and 5xx) to the following standardized format:
1313``` json
1414{
1515 "type" : " validation_error" ,
@@ -92,7 +92,12 @@ REST_FRAMEWORK = {
9292```
9393
9494### Notes
95- Standardized error responses when ` DEBUG=True ` for ** unhandled exceptions** are disabled by default. That is
95+ - This package is a DRF exception handler, so it standardizes errors that reach a DRF API view. That means it cannot
96+ handle errors that happen at the middleware level for example. To handle those as well, you can customize
97+ the necessary [ django error views] ( https://docs.djangoproject.com/en/dev/topics/http/views/#customizing-error-views ) .
98+ You can find more about that in [ this issue] ( https://github.com/ghazi-git/drf-standardized-errors/issues/44 ) .
99+
100+ - Standardized error responses when ` DEBUG=True ` for ** unhandled exceptions** are disabled by default. That is
96101to allow you to get more information out of the traceback. You can enable standardized errors instead with:
97102``` python
98103DRF_STANDARDIZED_ERRORS = {" ENABLE_IN_DEBUG_FOR_UNHANDLED_EXCEPTIONS" : True }
You can’t perform that action at this time.
0 commit comments