gusmobile

python gemini client library
git clone https://git.clttr.info/gusmobile.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 322a3c0fb683edc89c76e187ffb7d5380455b7ca
parent 8c59ce7759ca4763311f20a6da25b16558421386
Author: Natalie Pendragon <natpen@natpen.net>
Date:   Tue, 19 May 2020 09:41:26 -0400

Handle network read error

Diffstat:
Mgusmobile/client.py | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gusmobile/client.py b/gusmobile/client.py @@ -148,7 +148,11 @@ def fetch(raw_url): print("Header declared unknown encoding %s" % value) return # Read the response body over the network - body = f.read() + try: + body = f.read() + except Exception: + print("Error reading response over network!") + return if mime.startswith("text/"): try: content = codecs.decode(body, charset)