Handling Errors

[This is preliminary documentation and subject to change.]

Web-Based Enterprise Management (WBEM) providers can return extended error information using instances of the system class __ExtendedStatus. Applications can retrieve error information about operations completed with any of the asynchronous IWbemServices methods or methods from any of the other interfaces in the CIMOM API.

To access the error information, applications can call the COM function GetErrorInfo immediately after an error is indicated by an interface method, including any of the IWbemCallResult methods called during the processing of a semisynchronous call. GetErrorInfo returns a COM object that supports the IErrorInfo interface.

If errors occur during the processing of an asynchronous operation, the error object is delivered with the IWbemObjectSink::SetStatus method. The error object cannot be delivered through GetErrorInfo because there is no way to know when, or on which thread, such an asynchronous call is made.