From 6133e9144b89df044dbaf3d76101f501e55e8e46 Mon Sep 17 00:00:00 2001 From: DAWells Date: Mon, 14 Oct 2024 10:51:34 +0100 Subject: [PATCH] Simply getAFdata timeout message Raise a new exception without the full details from requests. Avoids overwhelming the user --- src/HLAfreq/HLAfreq.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HLAfreq/HLAfreq.py b/src/HLAfreq/HLAfreq.py index c10aea4..21efd57 100644 --- a/src/HLAfreq/HLAfreq.py +++ b/src/HLAfreq/HLAfreq.py @@ -256,7 +256,7 @@ def getAFdata(base_url, timeout=20, format=True, ignoreG=True): except requests.exceptions.ReadTimeout as e: raise Exception( "Requests timeout, try a larger `timeout` value for `getAFdata()`" - ) from e + ) from None # How many pages of results N = Npages(bs) print("%s pages of results" % N) @@ -271,7 +271,7 @@ def getAFdata(base_url, timeout=20, format=True, ignoreG=True): except requests.exceptions.ReadTimeout as e: raise Exception( "Requests timeout, try a larger `timeout` value for `getAFdata()`" - ) from e + ) from None tab = parseAF(bs) tabs.append(tab) print("Download complete")