From 59fc1071d9eccc4f80b2f29578936da918588ec6 Mon Sep 17 00:00:00 2001 From: Saqibur Rahman Date: Sat, 25 Nov 2023 23:52:44 +0600 Subject: [PATCH] Add information and exceptions.py to encourage custom exception handlers --- README.md | 7 +++++++ apps/core/exceptions.py | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 apps/core/exceptions.py diff --git a/README.md b/README.md index 2be7f23..541267e 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,13 @@ Currently we're proposing that major changes to the following, constitutes a new 1. Major optimizations 1. Major code reorganization and code refactor + +### Exception handling +You should probably add a custom exception handler to your project based on +who consumes your APIs. To learn how to create a custom exception handler, +you can check out the Django Rest Framework documentation at: +https://www.django-rest-framework.org/api-guide/exceptions/#custom-exception-handling + ### `config` * Contains project configuration files, including the primary URL file * ~~Contains settings split into `base`, `local`, `production` and `development`.~~. Update: As environment diff --git a/apps/core/exceptions.py b/apps/core/exceptions.py new file mode 100644 index 0000000..50dc327 --- /dev/null +++ b/apps/core/exceptions.py @@ -0,0 +1,6 @@ +""" + You should probably add a custom exception handler to your project based on + who consumes your APIs. To learn how to create a custom exception handler, + you can check out the Django Rest Framework documentation at: + https://www.django-rest-framework.org/api-guide/exceptions/#custom-exception-handling +""" \ No newline at end of file