Skip to content

Commit 91a05fb

Browse files
committed
trap only HTTP related exceptions
1 parent 07636b4 commit 91a05fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ronkyuu/tools.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ def getURLChain(targetURL):
5555
if ok:
5656
for resp in r.history:
5757
chain.append(r.url)
58-
except:
58+
except (requests.exceptions.RequestException, requests.exceptions.ConnectionError,
59+
requests.exceptions.HTTPError, requests.exceptions.URLRequired,
60+
requests.exceptions.TooManyRedirects, requests.exceptions.Timeout):
5961
ok = False
6062
return (ok, chain)
6163

0 commit comments

Comments
 (0)