Log exceptions that occur after response start

Fix #694
This commit is contained in:
Randall Leeds 2014-02-06 19:31:22 -08:00
parent 0226b2cd1f
commit b981014acc
2 changed files with 2 additions and 0 deletions

View File

@ -112,6 +112,7 @@ class AsyncWorker(base.Worker):
if resp and resp.headers_sent:
# If the requests have already been sent, we should close the
# connection to indicate the error.
self.log.exception("Error handling request")
try:
sock.shutdown(socket.SHUT_RDWR)
sock.close()

View File

@ -146,6 +146,7 @@ class SyncWorker(base.Worker):
if resp and resp.headers_sent:
# If the requests have already been sent, we should close the
# connection to indicate the error.
self.log.exception("Error handling request")
try:
client.shutdown(socket.SHUT_RDWR)
client.close()