CoreApplication.UnhandledErrorDetected CoreApplication.UnhandledErrorDetected CoreApplication.UnhandledErrorDetected CoreApplication.UnhandledErrorDetected Event


Occurs when there is an underlying error that is routed to the CoreApplication instance, as part of global error handling logic.

public : event EventHandler<UnhandledErrorDetectedEventArgs> UnhandledErrorDetected
// Register
event_token UnhandledErrorDetected(EventHandler<UnhandledErrorDetectedEventArgs> const& handler) const;

// Revoke with event_token
void UnhandledErrorDetected(event_token const& cookie) const;

// Revoke with event_revoker
UnhandledErrorDetected_revoker UnhandledErrorDetected(auto_revoke_t, EventHandler<UnhandledErrorDetectedEventArgs> const& handler) const;
public event EventHandler<UnhandledErrorDetectedEventArgs> UnhandledErrorDetected
Public Event UnhandledErrorDetected As EventHandler (Of UnhandledErrorDetectedEventArgs)


As part of an app's life cycle management code, developers can inspect error data (UnhandledError ) from an UnhandledErrorDetected event, and choose whether to mark the error as handled. If the error is marked handled in the event data, then execution can continue. If the error is not marked handled, the app and its process will be terminated.

Errors that can fire UnhandledErrorDetected include errors that are thrown by code within an async completed handler.

UnhandledErrorDetected will occur if an app-code event handler throws an error, but the reason that the handler was executed was that system code (not app code) raised the event. App code doesn't always see that error or see that the handler executed.

Returning a failure from any delegate clears the handled state of the error.