From a415ce70bef6d91036b00dd2c8544aed7aeeaaed Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Fri, 12 Apr 2019 06:15:18 -0700 Subject: Fixed #30451 -- Added ASGI handler and coroutine-safety. This adds an ASGI handler, asgi.py file for the default project layout, a few async utilities and adds async-safety to many parts of Django. --- django/core/exceptions.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'django/core/exceptions.py') diff --git a/django/core/exceptions.py b/django/core/exceptions.py index 0e85397b9c..dc084b8692 100644 --- a/django/core/exceptions.py +++ b/django/core/exceptions.py @@ -63,6 +63,11 @@ class RequestDataTooBig(SuspiciousOperation): pass +class RequestAborted(Exception): + """The request was closed before it was completed, or timed out.""" + pass + + class PermissionDenied(Exception): """The user did not have permission to do that""" pass @@ -181,3 +186,8 @@ class ValidationError(Exception): class EmptyResultSet(Exception): """A database query predicate is impossible.""" pass + + +class SynchronousOnlyOperation(Exception): + """The user tried to call a sync-only function from an async context.""" + pass -- cgit v1.3