Skip to content

Instantly share code, notes, and snippets.

@jorenham jorenham/main.py
Last active Jan 18, 2018

Embed
What would you like to do?
Best exception handling in Python
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
You can’t perform that action at this time.