UnhandledExceptionEventArgs UnhandledExceptionEventArgs UnhandledExceptionEventArgs Class

Provides data for the UnhandledException event.

Syntax

Declaration

public sealed class UnhandledExceptionEventArgspublic sealed class UnhandledExceptionEventArgsPublic NotInheritable Class UnhandledExceptionEventArgs

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 summary

Gets the HRESULT code associated with the unhandled exception.

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

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

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 Exceptionpublic HResult Exception { get; }

    Property Value

  • Handled
    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 boolpublic bool Handled { get; set; }

    Property Value

    • 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.

  • Message
    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 stringpublic string Message { get; }

    Property Value

    • 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.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Xaml.dll