Skip to content

Instantly share code, notes, and snippets.

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

Embed
What would you like to do?
Best exception handling in Python
import sys
import webbrowser
def main():
return 42/0
def excepthook(type_, value, traceback):
webbrowser.open_new_tab('https://stackoverflow.com/search?q=[python] {} {}'.format(type_, value))
sys.__excepthook__(type_, value, traceback)
sys.excepthook = excepthook
if __name__== '__main__':
main()
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.