diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2019-04-12 06:15:18 -0700 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-06-20 12:29:43 +0200 |
| commit | a415ce70bef6d91036b00dd2c8544aed7aeeaaed (patch) | |
| tree | 3583cef22e9b56d2ed52456ab586d9c47620bc51 /docs/ref/exceptions.txt | |
| parent | cce47ff65a4dd3786c049ec14ee889e128ca7de9 (diff) | |
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.
Diffstat (limited to 'docs/ref/exceptions.txt')
| -rw-r--r-- | docs/ref/exceptions.txt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/ref/exceptions.txt b/docs/ref/exceptions.txt index ee3f5260c9..208b4d6672 100644 --- a/docs/ref/exceptions.txt +++ b/docs/ref/exceptions.txt @@ -162,6 +162,40 @@ or model are classified as ``NON_FIELD_ERRORS``. This constant is used as a key in dictionaries that otherwise map fields to their respective list of errors. +``RequestAborted`` +------------------ + +.. exception:: RequestAborted + + .. versionadded:: 3.0 + + The :exc:`RequestAborted` exception is raised when a HTTP body being read + in by the handler is cut off midstream and the client connection closes, + or when the client does not send data and hits a timeout where the server + closes the connection. + + It is internal to the HTTP handler modules and you are unlikely to see + it elsewhere. If you are modifying HTTP handling code, you should raise + this when you encounter an aborted request to make sure the socket is + closed cleanly. + +``SynchronousOnlyOperation`` +---------------------------- + +.. exception:: SynchronousOnlyOperation + + .. versionadded:: 3.0 + + The :exc:`SynchronousOnlyOperation` exception is raised when code that + is only allowed in synchronous Python code is called from an asynchronous + context (a thread with a running asynchronous event loop). These parts of + Django are generally heavily reliant on thread-safety to function and don't + work correctly under coroutines sharing the same thread. + + If you are trying to call code that is synchronous-only from an + asynchronous thread, then create a synchronous thread and call it in that. + You can accomplish this is with ``asgiref.sync.sync_to_async``. + .. currentmodule:: django.urls URL Resolver exceptions |
