From 419aafcf112fdb558f2a36fc4d92cd2b7ad2b936 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Fri, 20 Jan 2023 08:10:56 -0500 Subject: protocols: Show errors instead of hanging or hiding them --- protocol/gemini.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'protocol/gemini.py') diff --git a/protocol/gemini.py b/protocol/gemini.py index b4cccbe..05f86ce 100644 --- a/protocol/gemini.py +++ b/protocol/gemini.py @@ -25,8 +25,8 @@ class GeminiProtocol(): s = context.wrap_socket(s, server_hostname = hostname) s.sendall((url + '\r\n').encode("UTF-8")) fp = s.makefile("rb") - except: - return ("text/error",["error"]) + except Exception as e: + return ("text/error",["error\n", str(e)]) header = fp.readline() header = header.decode("UTF-8").strip() if header[0:1] == "2": -- cgit 1.4.1