MHammond at skippinet.com.au
Tue Jun 1 01:01:00 CEST 1999
Gaetan Corneau wrote in message
<816010E2456BD111A48700805FBBE2EEFDF2D1 at ex-quebec-u1.baan.com>...
>I was told that in Visual Basic, there is object called "Err" I can access
>to retrieve error messages.
>Is that object (or an equivalent) accessible in Python? Or do I just catch
>an exception and question it? If so, what exception do I catch?
except pythoncom.com_error, (hr, desc, exc, argErr):
In this case, "desc" describes the hr - ie, is likely to be a generic
message. The specific info is in the exc tuple (if not None):
wCode, source, desc, helpfile, helpcontext, scode = exc
source desc, helpfile are strings. "desc" is the item you are after if it
Eg, here is what I use:
hr, msg, exc, arg = exc_info
if exc and exc:
More information about the Python-list