🔧 log Connection lost only if debug
This commit is contained in:
parent
0189e4ed59
commit
7610c0fb2e
|
@ -342,8 +342,10 @@ class HttpProtocol(asyncio.Protocol):
|
||||||
self.url, type(response))
|
self.url, type(response))
|
||||||
self.write_error(ServerError('Invalid response type'))
|
self.write_error(ServerError('Invalid response type'))
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
logger.error('Connection lost before response written @ %s',
|
if self._debug:
|
||||||
self.request.ip)
|
logger.error('Connection lost before response written @ %s',
|
||||||
|
self.request.ip)
|
||||||
|
keep_alive = False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.bail_out(
|
self.bail_out(
|
||||||
"Writing response failed, connection closed {}".format(
|
"Writing response failed, connection closed {}".format(
|
||||||
|
@ -379,8 +381,10 @@ class HttpProtocol(asyncio.Protocol):
|
||||||
self.url, type(response))
|
self.url, type(response))
|
||||||
self.write_error(ServerError('Invalid response type'))
|
self.write_error(ServerError('Invalid response type'))
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
logger.error('Connection lost before response written @ %s',
|
if self._debug:
|
||||||
self.request.ip)
|
logger.error('Connection lost before response written @ %s',
|
||||||
|
self.request.ip)
|
||||||
|
keep_alive = False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.bail_out(
|
self.bail_out(
|
||||||
"Writing response failed, connection closed {}".format(
|
"Writing response failed, connection closed {}".format(
|
||||||
|
@ -407,8 +411,9 @@ class HttpProtocol(asyncio.Protocol):
|
||||||
version = self.request.version if self.request else '1.1'
|
version = self.request.version if self.request else '1.1'
|
||||||
self.transport.write(response.output(version))
|
self.transport.write(response.output(version))
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
logger.error('Connection lost before error written @ %s',
|
if self._debug:
|
||||||
self.request.ip if self.request else 'Unknown')
|
logger.error('Connection lost before error written @ %s',
|
||||||
|
self.request.ip if self.request else 'Unknown')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.bail_out(
|
self.bail_out(
|
||||||
"Writing error failed, connection closed {}".format(
|
"Writing error failed, connection closed {}".format(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user