UnhandledExceptionEventArgs UnhandledExceptionEventArgs UnhandledExceptionEventArgs UnhandledExceptionEventArgs Class

Definition

Provides data for the UnhandledException event.

public : sealed class UnhandledExceptionEventArgs : IUnhandledExceptionEventArgs
public sealed class UnhandledExceptionEventArgs : IUnhandledExceptionEventArgs
Public NotInheritable Class UnhandledExceptionEventArgs Implements IUnhandledExceptionEventArgs
// This class does not provide a public constructor.
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 Exception

Gets the HRESULT code associated with the unhandled exception.

public : HResult Exception { get; }
public Exception Exception { get; }
Public ReadOnly Property Exception As Exception
var exception = unhandledExceptionEventArgs.exception;
Value
HResult Exception Exception Exception

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

See Also

Handled Handled Handled Handled

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

public : Platform::Boolean Handled { get; set; }
public bool Handled { get; set; }
Public ReadWrite Property Handled As bool
var bool = unhandledExceptionEventArgs.handled;
unhandledExceptionEventArgs.handled = bool;
Value
Platform::Boolean bool bool bool

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

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 Message

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

public : Platform::String Message { get; }
public string Message { get; }
Public ReadOnly Property Message As string
var string = unhandledExceptionEventArgs.message;
Value
Platform::String string string string

The message string, which may be useful for debugging.

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