Skip to content

Commit 17868b9

Browse files
committed
document that the package does not handle errors that do not reach a DRF API view
1 parent 35d87a3 commit 17868b9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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
96101
to allow you to get more information out of the traceback. You can enable standardized errors instead with:
97102
```python
98103
DRF_STANDARDIZED_ERRORS = {"ENABLE_IN_DEBUG_FOR_UNHANDLED_EXCEPTIONS": True}

0 commit comments

Comments
 (0)