Hi,
I am trying to automate Lotus Notes using comtypes and want to handle
error conditions (e.g. wrong password) by catching COM exceptions.
Unfortunately, Lotus Notes always gives error code -2147217504. So I
decided to check the error description. Following is a sample COMError
object:

COMError(-2147217504, None, (u'Notes error: Wrong Password. (Passwords
are case sensitive - be sure to use correct upper and lower case.)',
u'NotesSession', None, 0, None))

I checked the code of COMError in
http://svn.python.org/view/python/tags/r251/Modules/_ctypes/_ctypes.c?rev=54864&view=auto
and is seems to me that COMError objects should have "hresult, text,
details" attributes. However, the COMError object I caught had only
args attribute.

My questions are:
        1. err.args[2][0] returns description. Can I get away with
using err.args[2][0] without checking for error bounds (assuming only
COMError is caught)?
        2. Will COMError grow "hresult, text, details" attributes in future?

Thanks for your time
- Suraj

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to