UnhandledExceptionEventArgs UnhandledExceptionEventArgs UnhandledExceptionEventArgs Class

Definition

Provides data for the UnhandledException event.

public sealed class UnhandledExceptionEventArgs : IUnhandledExceptionEventArgspublic sealed class UnhandledExceptionEventArgs : IUnhandledExceptionEventArgsPublic NotInheritable Class UnhandledExceptionEventArgs Implements IUnhandledExceptionEventArgs
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

For more info on how to write a handler based on the UnhandledExceptionEventHandler delegate, see Exception handling for in C# or Visual Basic and Remarks in UnhandledException.

If you're using Visual C++ component extensions (C++/CX), see Exceptions (C++/CX).

Properties

Exception Exception Exception

Gets the HRESULT code associated with the unhandled exception.

public HResult Exception { get; }public Exception Exception { get; }Public ReadOnly Property Exception As Exception
Value
HResult HResult HResult

The HRESULT code (for Visual C++ component extensions (C++/CX)), or a mapped common language runtime (CLR) System.Exception.

Attributes
See Also

Handled Handled Handled

Gets or sets a value that indicates whether the exception is handled.

public bool Handled { get; set; }public bool Handled { get; set; }Public ReadWrite Property Handled As bool
Value
bool bool bool

true to mark the exception as handled, which indicates that the event system should not process it further; otherwise, false.

Attributes

Remarks

Do not routinely set this value to true, that is not always safe and may not guarantee that the app wouldn't terminate anyways. For more info, see Exception handling for in C# or Visual Basic and Remarks in UnhandledException.

See Also

Message Message Message

Gets the message string as passed by the originating unhandled exception.

public string Message { get; }public string Message { get; }Public ReadOnly Property Message As string
Value
string string string

The message string, which may be useful for debugging.

Attributes

Remarks

The message is coming from info that's propagated by the original system or runtime app error. The message is not guaranteed to be an exact match to the original error message (as seen in native stacks or output windows). For more info on error propagation and exception handling techniques, see Exception handling for in C# or Visual Basic and Remarks in UnhandledException.

See Also

See Also