Skip to content

Instantly share code, notes, and snippets.

@89465127
Created April 26, 2013 17:38
Show Gist options
  • Save 89465127/5468955 to your computer and use it in GitHub Desktop.
Save 89465127/5468955 to your computer and use it in GitHub Desktop.
Simple example showing how you can still raise an error in Python, but report more details with it.
other_var = 42
try:
print 1/0
except Exception as e:
print "\nError encountered. Other var = {}\n".format(other_var)
raise e
print 'You will not see this text'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment