Skip to main content
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 static event EventHandler<UnhandledErrorDetectedEventArgs> UnhandledErrorDetected

Public Shared Event UnhandledErrorDetected As EventHandler(Of UnhandledErrorDetectedEventArgs)

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

Event information

Delegate System.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.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


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



Requirements (Windows 8.x and Windows Phone 8.x)

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