I have seen code which 'converts' exception objects to the error string using str() like this:
try:
...
except Exception, err:
print str(err)
Does err contain some public 'interface' through which its error string is fetched? I want to have the same functionality for my custom exception class. One way i can think of doing is just define a global str() method for all my exception objects and then inside just return the error string using getter. Is that how I should do it?