From 292ead1fe0f779254590a47a352d545d57132266 Mon Sep 17 00:00:00 2001 From: ghazi-git Date: Mon, 6 Jun 2022 12:46:11 +0100 Subject: [PATCH] add drf-standardized-errors to third party packages (#8487) Co-authored-by: Tom Christie --- docs/api-guide/exceptions.md | 9 +++++++++ docs/community/third-party-packages.md | 2 ++ 2 files changed, 11 insertions(+) diff --git a/docs/api-guide/exceptions.md b/docs/api-guide/exceptions.md index e62a7e4f9..347541d56 100644 --- a/docs/api-guide/exceptions.md +++ b/docs/api-guide/exceptions.md @@ -260,6 +260,15 @@ Set as `handler400`: handler400 = 'rest_framework.exceptions.bad_request' +# Third party packages + +The following third-party packages are also available. + +## DRF Standardized Errors + +The [drf-standardized-errors][drf-standardized-errors] package provides an exception handler that generates the same format for all 4xx and 5xx responses. It is a drop-in replacement for the default exception handler and allows customizing the error response format without rewriting the whole exception handler. The standardized error response format is easier to document and easier to handle by API consumers. + [cite]: https://doughellmann.com/blog/2009/06/19/python-exception-handling-techniques/ [authentication]: authentication.md [django-custom-error-views]: https://docs.djangoproject.com/en/dev/topics/http/views/#customizing-error-views +[drf-standardized-errors]: https://github.com/ghazi-git/drf-standardized-errors diff --git a/docs/community/third-party-packages.md b/docs/community/third-party-packages.md index d4e590952..9513b13d1 100644 --- a/docs/community/third-party-packages.md +++ b/docs/community/third-party-packages.md @@ -149,6 +149,7 @@ To submit new content, [open an issue][drf-create-issue] or [create a pull reque * [django-api-client][django-api-client] - DRF client that groups the Endpoint response, for use in CBVs and FBV as if you were working with Django's Native Models.. * [fast-drf] - A model based library for making API development faster and easier. * [django-requestlogs] - Providing middleware and other helpers for audit logging for REST framework. +* [drf-standardized-errors][drf-standardized-errors] - DRF exception handler to standardize error responses for all API endpoints. [cite]: http://www.software-ecosystems.com/Software_Ecosystems/Ecosystems.html [cookiecutter]: https://github.com/jpadilla/cookiecutter-django-rest-framework @@ -239,3 +240,4 @@ To submit new content, [open an issue][drf-create-issue] or [create a pull reque [rest-framework-actions]: https://github.com/AlexisMunera98/rest-framework-actions [fast-drf]: https://github.com/iashraful/fast-drf [django-requestlogs]: https://github.com/Raekkeri/django-requestlogs +[drf-standardized-errors]: https://github.com/ghazi-git/drf-standardized-errors