RoFailFastWithErrorContext function (roerrorapi.h)

Raises a non-continuable exception in the current process.


void RoFailFastWithErrorContext(
  [in] HRESULT hrError


[in] hrError

The HRESULT associated with the current error. The exception is raised for any value of hrError.

Return value



The RoFailFastWithErrorContext function raises a non-continuable exception in the current process when an unhandled failure is encountered, which prevents the process from continuing execution in an undefined state.

Call the RoFailFastWithErrorContext function when a failure occurs in a completion delegate for a completed asynchronous operation, or when a failure occurs in an event handler when an event is raised.

The process that calls RoFailFastWithErrorContext is terminated by a call to RaiseFailFastException. The function does not validate the parameters and raises an exception for any value of the inputs.

Call the RoCaptureErrorContext function to save an IRestrictedErrorInfo object that's associated with the current thread. The RoFailFastWithErrorContext function uses this contextual information to report the error call stack to the Windows Error Reporting service (WER), if it's enabled.


Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header roerrorapi.h
Library RuntimeObject.lib
DLL ComBase.dll

See also