IAsyncErrorNotify.OnError(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Handles errors for asynchronous batch work.
public:
void OnError(int hresult);
public void OnError (int hresult);
abstract member OnError : int -> unit
Public Sub OnError (hresult As Integer)
Parameters
- hresult
- Int32
The HRESULT of the error that occurred while the batch work was running asynchronously.
Remarks
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.