UnobservedTaskExceptionEventArgs 类

定义

为在出错的 Task 的异常未观察到时引发的事件提供数据。Provides data for the event that is raised when a faulted Task's exception goes unobserved.

public ref class UnobservedTaskExceptionEventArgs : EventArgs
public class UnobservedTaskExceptionEventArgs : EventArgs
type UnobservedTaskExceptionEventArgs = class
    inherit EventArgs
Public Class UnobservedTaskExceptionEventArgs
Inherits EventArgs
继承
UnobservedTaskExceptionEventArgs

注解

Exception 属性用于检查异常, 而不会将其标记为 "已观察" SetObserved , 而使用方法将异常标记为 "已观察"。The Exception property is used to examine the exception without marking it as observed, whereas the SetObserved method is used to mark the exception as observed. 将异常标记为 "已观察" 可防止它触发异常升级策略, 该策略在默认情况下会终止进程。Marking the exception as observed prevents it from triggering exception escalation policy which, by default, terminates the process.

构造函数

UnobservedTaskExceptionEventArgs(AggregateException)

使用未观察到的异常初始化 UnobservedTaskExceptionEventArgs 类的新实例。Initializes a new instance of the UnobservedTaskExceptionEventArgs class with the unobserved exception.

属性

Exception

未观察到的异常。The Exception that went unobserved.

Observed

获取此异常是否已标记为“已观察到”。Gets whether this exception has been marked as "observed."

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
SetObserved()

Exception 标记为“已观察到”,这样将阻止该异常触发默认情况下会终止进程的异常升级策略。Marks the Exception as "observed," thus preventing it from triggering exception escalation policy which, by default, terminates the process.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅