Skip to content

Instantly share code, notes, and snippets.

@starenka
Created March 13, 2012 21:14
Show Gist options
  • Save starenka/2031659 to your computer and use it in GitHub Desktop.
Save starenka/2031659 to your computer and use it in GitHub Desktop.
replacing exception hook to catch all excpetion w/ messing the code
#!/usr/bin/env python
import sys
def catch_all(exc_type, exc_value, traceback):
sys.stderr.write('[!] %s\n'%exc_value)
sys.excepthook = catch_all
if __name__ == '__main__':
raise RuntimeError('CAN I HAZ COOKIE?')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment