MethodExecutionArgs.Exception Property |
Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 2023.0.3.0 (2023.0.3.0)
public Exception Exception { get; set; }
Property Value
Type: ExceptionAn Exception, or null if the method is exiting normally.
This property is only available inside the OnException(MethodExecutionArgs) and OnException(MethodExecutionArgs) advices.
You can replace the exception by setting this property and also setting FlowBehavior to ThrowException. You can also throw a new exception from the advice if you need to replace the current exception.