Skip to content

Instantly share code, notes, and snippets.

@alexland
Created October 7, 2014 05:44
Show Gist options
  • Save alexland/0cd358e114c93d3617db to your computer and use it in GitHub Desktop.
Save alexland/0cd358e114c93d3617db to your computer and use it in GitHub Desktop.
your code throws an exception, but you can't write a handler because you don't know the module in which the exception class is defined
try:
...
except Exception as xe:
print("caught exception defined in module {}".format(xe.__class__.__module__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment