CoreApplication.UnhandledErrorDetected event

Applies to Windows and Windows Phone

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


static event EventHandler<UnhandledErrorDetectedEventArgs>^ UnhandledErrorDetected {
   Windows::Foundation::EventRegistrationToken add(EventHandler<UnhandledErrorDetectedEventArgs>^ value);
   void remove(Windows::Foundation::EventRegistrationToken token);

Event information

DelegateSystem.EventHandler<UnhandledErrorDetectedEventArgs> [.NET] | Windows.Foundation.EventHandler<UnhandledErrorDetectedEventArgs> [C++]


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.


Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]


Windows::ApplicationModel::Core [C++]



See also




© 2014 Microsoft