On the risk of sounding extremely stupid, Does anyone know how to print a string representation of an exception. i.e. just the type of error? I have code that catches all errors and would like to then print the type of error as a string. My code is:
def catchException():
try:
f [6]
except:
print "This is where I want to print the string representation of the error message"
else:
print "No exception raised."
Any help would be appreciated.
Thanks.