sys.exc_info() into string

Magnus spammers.do.not.bother at void.bogus
Sun Jun 23 15:05:14 EDT 2002


Hi,

in my program I am catching exceptions that I might have missed by using 
something like:

try:
        doMyStuff()
except:
        type = sys.exc_info()[0]
        syslog.syslog(syslog.LOG_EMERG, "My program: unexpected error" + type)

The thing is that I can not figure out how to make "type" into a string 
above so I can use it for e.g. syslog(). Is there an easy way of doing 
this?

Thanks,
Magnus




More information about the Python-list mailing list