Share via


PropertyInterceptionContext<TValue>.Exception Property

Definition

If this property is set before the operation has executed, then execution of the operation will be suppressed and the set exception will be thrown instead. Otherwise, if the operation fails, then this property will be set to the exception that was thrown. In either case, interceptors that run after the operation can change this property to change the exception that will be thrown, or set this property to null to cause no exception to be thrown at all.

public Exception Exception { get; set; }
member this.Exception : Exception with get, set
Public Property Exception As Exception

Property Value

Remarks

When an operation fails both this property and the OriginalException property are set to the exception that was thrown. However, the this property can be set or changed by interceptors, while the OriginalException property will always represent the original exception thrown.

Applies to