IAsyncErrorNotify::OnError method (comsvcs.h)

Called by COM+ when an error occurs in your asynchronous batch work.

Syntax

HRESULT OnError(
  [in] HRESULT hr
);

Parameters

[in] hr

The HRESULT value of the error that occurred while your batch work was running asynchronously.

Return value

This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, E_FAIL, and S_OK.

Remarks

This method should be implemented to gracefully handle errors that occur when your batch work is running asynchronously. Because the process terminates (FailFast) on any unrecoverable error, without this method you have no way of knowing when errors occur in your asynchronous batch work. The process also terminates when this method returns an error as its return value.

The batch work itself is implemented in IServiceCall::OnCall, and it is run asynchronously by calling IServiceActivity::AsynchronousCall using the IServiceActivity pointer that was returned from the call to CoCreateActivity.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header comsvcs.h

See also

IAsyncErrorNotify