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():
|
||||
raise StopIteration()
|
||||
except Exception:
|
||||
if resp.headers_sent:
|
||||
if resp and resp.headers_sent:
|
||||
# If the requests have already been sent, we should close the
|
||||
# connection to indicate the error.
|
||||
try:
|
||||
|
||||
@ -144,7 +144,7 @@ class SyncWorker(base.Worker):
|
||||
except socket.error:
|
||||
raise
|
||||
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
|
||||
# connection to indicate the error.
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user