Catch broken pipe error

This commit is contained in:
Scott Wallace 2022-06-03 01:45:45 +01:00
parent 2f9830c16a
commit b0e599dc68
Signed by: scott
GPG key ID: AA742FDC5AFE2A72

View file

@ -61,7 +61,10 @@ class HTTPHandler(MetricsHandler): # type: ignore[misc]
"""
self.send_response(int(status) or 500)
self.end_headers()
self.wfile.write(bytes(str(message).encode()))
try:
self.wfile.write(bytes(str(message).encode()))
except BrokenPipeError:
pass
def _metrics(self) -> None:
"""