mirror of
https://github.com/django/daphne.git
synced 2025-06-03 04:33:22 +03:00
Move ResponseLater into exceptions module
This commit is contained in:
parent
5ff77719be
commit
38c6df8125
16
channels/exceptions.py
Normal file
16
channels/exceptions.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
class ConsumeLater(Exception):
|
||||
"""
|
||||
Exception that says that the current message should be re-queued back
|
||||
onto its channel as it's not ready to be consumd yet (e.g. global order
|
||||
is being enforced)
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class ResponseLater(Exception):
|
||||
"""
|
||||
Exception raised inside a Django view when the view has passed
|
||||
responsibility for the response to another consumer, and so is not
|
||||
returning a response.
|
||||
"""
|
||||
pass
|
|
@ -14,6 +14,8 @@ from django.core.urlresolvers import set_script_prefix
|
|||
from django.utils import six
|
||||
from django.utils.functional import cached_property
|
||||
|
||||
from .exceptions import ResponseLater as ResponseLaterOuter
|
||||
|
||||
logger = logging.getLogger('django.request')
|
||||
|
||||
|
||||
|
@ -23,13 +25,7 @@ class AsgiRequest(http.HttpRequest):
|
|||
dict, and wraps request body handling.
|
||||
"""
|
||||
|
||||
class ResponseLater(Exception):
|
||||
"""
|
||||
Exception that will cause any handler to skip around response
|
||||
transmission and presume something else will do it later.
|
||||
"""
|
||||
def __init__(self):
|
||||
Exception.__init__(self, "Response later")
|
||||
ResponseLater = ResponseLaterOuter
|
||||
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
|
|
Loading…
Reference in New Issue
Block a user