Handle 404 errors

This commit is contained in:
bashrc committed 2019-08-16 20:45:48 +01:00
1 parent db38a6388c
commit 7e43a00c4d
1 file changed
+5 -1
+5 -1
View File
@@ -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'):