Skip to content

Commit

Permalink
trap only HTTP related exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
bear committed Sep 6, 2017
1 parent 07636b4 commit 91a05fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ronkyuu/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def getURLChain(targetURL):
if ok:
for resp in r.history:
chain.append(r.url)
except:
except (requests.exceptions.RequestException, requests.exceptions.ConnectionError,
requests.exceptions.HTTPError, requests.exceptions.URLRequired,
requests.exceptions.TooManyRedirects, requests.exceptions.Timeout):
ok = False
return (ok, chain)

Expand Down

0 comments on commit 91a05fb

Please sign in to comment.