MetalamaAPI documentationPost­Sharp API migrationPost­Sharp.​AspectsOn­Exception­Aspect
Open sandboxFocus

OnExceptionAspect Class

In Metalama, use OverrideMethodAspect and write your own try/catch block.

Inheritance
OnExceptionAspect
Namespace: PostSharp.Aspects
Assembly: Metalama.Migration.dll
Syntax
[MulticastAttributeUsage]
public abstract class OnExceptionAspect : MethodLevelAspect, IMethodLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, IOnExceptionAspect, IMethodLevelAspect, IAspect

Constructors

Name Description
OnExceptionAspect()

Properties

Name Description
SemanticallyAdvisedMethodKinds

In Metalama, implement different methods OverrideMethod(), OverrideAsyncMethod(), OverrideEnumerableMethod() or OverrideEnumeratorMethod(), and set the properties UseAsyncTemplateForAnyAwaitable or UseEnumerableTemplateForAnyEnumerable.

UnsupportedTargetAction

There is no equivalent in Metalama. Unsupported targets will throw an exception.

Methods

Name Description
CreateAspectConfiguration()

No equivalent in Metalama.

GetExceptionType(MethodBase)

There is no equivalent in Metalama because you write your own try/catch code in the template.

OnException(MethodExecutionArgs)

Implement OverrideMethod() and write your own try/catch block.

SetAspectConfiguration(AspectConfiguration, MethodBase)

Not supported in Metalama.