Created
November 16, 2012 17:12
-
-
Save c0ldlimit/4089081 to your computer and use it in GitHub Desktop.
Python: Printing Exception Traceback #c0ldlimit #python #traceback
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
#Traceback.format_exc() or sys.exc_info() will yeild more info if thats what you want. | |
import traceback | |
import sys | |
try: | |
do_stuff() | |
except Exception, err: | |
print traceback.format_exc() | |
#or | |
print sys.exc_info()[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment