If I have that code:
try: some_method() except Exception, e:
How can I get this Exception value (string representation I mean)?
If you don't know the type/origin of the error, you can try:
import sys try: doSomethingWrongHere() except: print('Error: {}'.format(sys.exc_info()[0]))
But be aware, you'll get pep8 warning:
[W] PEP 8 (E722): do not use bare except