diff --git a/dockstat.py b/dockstat.py index d5e82ba..0786610 100644 --- a/dockstat.py +++ b/dockstat.py @@ -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: """