Last active
September 28, 2019 22:34
-
-
Save jorenham/193cf7fb3474887651b10c4f88ea0417 to your computer and use it in GitHub Desktop.
Best exception handling in Python
This file contains 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 webbrowser | |
def main(): | |
return 42/0 | |
if __name__== '__main__': | |
try: | |
main() | |
except Exception as e: | |
webbrowser.open_new_tab('https://stackoverflow.com/search?q=[python] {}'.format(e)) | |
raise e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment