From 7e43a00c4d2ef4f4852d6a15fa6aa9345e2c48bc Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 16 Aug 2019 20:45:48 +0100 Subject: [PATCH] Handle 404 errors --- daemon.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon.py b/daemon.py index 87126b87..5db861f9 100644 --- a/daemon.py +++ b/daemon.py @@ -171,7 +171,11 @@ class PubServer(BaseHTTPRequestHandler): self.send_header('Content-Type', 'text/html; charset=utf-8') self.send_header('Content-Length', str(len(msg))) self.end_headers() - self.wfile.write(msg) + try: + self.wfile.write(msg) + except Exception as e: + print('Error when showing 404') + print(e) def _webfinger(self) -> bool: if not self.path.startswith('/.well-known'):