Open sandboxFocus

Interface IOnExceptionAspect

Runtime semantics of an aspect that, when applied on a method, defines an exception handler around the whole method body and lets the implementation of this interface handle the exception.

Namespace: PostSharp.Aspects
Assembly: PostSharp.dll
Syntax
[HasInheritedAttribute]
public interface IOnExceptionAspect : IMethodLevelAspect, IAspect
Remarks

See OnExceptionAspect for details.

A class that implements this interface directly, instead of deriving from OnExceptionAspect, cannot override GetExceptionType(MethodBase). To configure the aspect, for example to set the type of handled exceptions, implement GetAspectConfiguration(object) and return an OnExceptionAspectConfiguration.

Methods

Name Description
OnException(MethodExecutionArgs)

Method executed after the body of the methods to which this aspect is applied, when the method failed with an exception, that is, in a catch block.

See Also