Created
November 13, 2015 12:25
-
-
Save Colorfulstan/48ddfd731bebb64dc568 to your computer and use it in GitHub Desktop.
try catch with stacktrace
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 traceback | |
try: | |
raise ValueError | |
except: | |
tb = traceback.format_exc() | |
else: | |
tb = "No error" | |
finally: | |
print tb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment