From e0a5ca94ecdd2194aecd8f4fb8803aae3de1d965 Mon Sep 17 00:00:00 2001 From: dece Date: Mon, 15 Nov 2021 09:52:01 +0100 Subject: [PATCH] browser/gemini: fix crash during handshake --- bebop/browser/gemini.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bebop/browser/gemini.py b/bebop/browser/gemini.py index c53aef0..4fad561 100644 --- a/bebop/browser/gemini.py +++ b/bebop/browser/gemini.py @@ -111,7 +111,11 @@ def open_gemini_url( trust_always=True ) - data = req.proceed() + try: + data = req.proceed() + except OSError: + browser.set_status_error(f"Connection error ({url}).") + return None if not data: browser.set_status_error(f"Response empty or timed out ({url}).") return None