mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
resp maybe None when pre_request raise exceptions
This commit is contained in:
parent
53c4484bb8
commit
b4c286bc81
@ -105,7 +105,7 @@ class AsyncWorker(base.Worker):
|
|||||||
if resp.should_close():
|
if resp.should_close():
|
||||||
raise StopIteration()
|
raise StopIteration()
|
||||||
except Exception:
|
except Exception:
|
||||||
if resp.headers_sent:
|
if resp and resp.headers_sent:
|
||||||
# If the requests have already been sent, we should close the
|
# If the requests have already been sent, we should close the
|
||||||
# connection to indicate the error.
|
# connection to indicate the error.
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -144,7 +144,7 @@ class SyncWorker(base.Worker):
|
|||||||
except socket.error:
|
except socket.error:
|
||||||
raise
|
raise
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if resp.headers_sent:
|
if resp and resp.headers_sent:
|
||||||
# If the requests have already been sent, we should close the
|
# If the requests have already been sent, we should close the
|
||||||
# connection to indicate the error.
|
# connection to indicate the error.
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user