Product SiteDocumentation Site

3.4. Errors

In the c+\+ interface, each method call returns a HRESULT containing a success or failure value. Since python is an exception-based language, all HRESULT errors are stripped from the call and ignored if there is no error. If an error has occurred, an exception of the MAPI.Exception type is raised.
Although this creates a pleasant look of the code, it does have one major drawback. In MAPI, there are fatal errors (which have the top bit set, so have values 0x8xxxxxxx) and warning errors (which do not have the top bit set). However, warnings actually behave more like success cases; the function still returns a value, but some minor part of the operation apparently failed.
Since there is no such thing as a warning in exceptions, currently warnings are treated exactly the same as success. Possibly future versions will change this, but will definitely not raise an exception.