Last active
April 26, 2018 07:57
-
-
Save panchambharadwaj/82e6019886ea94d8350f3022d75c2fcd to your computer and use it in GitHub Desktop.
Graceful way to handle requests exception handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| try: | |
| r = requests.get('url') | |
| except requests.exceptions.RequestException as e: | |
| print e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment