IAsyncErrorNotify.OnError Method (Int32)


Handles errors for asynchronous batch work.

Namespace:   System.EnterpriseServices
Assembly:  System.EnterpriseServices (in System.EnterpriseServices.dll)

void OnError(
	int hresult


Type: System.Int32

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

This method should be implemented to gracefully handle errors that occur when batch work is running asynchronously. Because the process terminates (failfast) on any unrecoverable error, without this method there is no way of knowing when errors occur in asynchronous batch work. The process also terminates when this method returns an error as its return value. The batch work itself is implemented in OnCall, and it is run asynchronously by calling AsynchronousCall.

This method supports the standard return values E_FAIL, E_INVALIDARG, and E_OUTOFMEMORY, as well as S_OK, which indicates the method call returned successfully.

.NET Framework
Available since 1.1
Return to top