Custom attribute that, when applied to a method, defines an exception handler around the whole method and calls a custom method in this exception handler.

Namespace:  PostSharp.Laos
Assembly:  PostSharp.Laos (in PostSharp.Laos.dll)

Syntax

Visual Basic (Declaration)
<SerializableAttribute> _
<AttributeUsageAttribute(AttributeTargets.Assembly Or AttributeTargets.Class Or AttributeTargets.Struct Or AttributeTargets.Constructor Or AttributeTargets.Method Or AttributeTargets.Property Or AttributeTargets.Event, AllowMultiple := True,  _
	Inherited := False)> _
<MulticastAttributeUsageAttribute(MulticastTargets.Default Or MulticastTargets.Method Or MulticastTargets.Constructor, TargetMemberAttributes := MulticastAttributes.Default Or MulticastAttributes.Private Or MulticastAttributes.Protected Or MulticastAttributes.Internal Or MulticastAttributes.InternalAndProtected Or MulticastAttributes.InternalOrProtected Or MulticastAttributes.Public Or MulticastAttributes.AnyVisibility Or MulticastAttributes.Static Or MulticastAttributes.Instance Or MulticastAttributes.AnyScope Or MulticastAttributes.NonAbstract Or MulticastAttributes.Managed,  _
	AllowMultiple := True)> _
Public MustInherit Class OnExceptionAspect _
	Inherits ExceptionHandlerAspect _
	Implements IOnExceptionAspect, IExceptionHandlerAspect, ILaosMethodLevelAspect, ILaosWeavableAspect,  _
	IInstanceBoundLaosAspect, ILaosAspect
C#
[SerializableAttribute]
[AttributeUsageAttribute(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Constructor|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Event, AllowMultiple = true, 
	Inherited = false)]
[MulticastAttributeUsageAttribute(MulticastTargets.Default|MulticastTargets.Method|MulticastTargets.Constructor, TargetMemberAttributes = MulticastAttributes.Default|MulticastAttributes.Private|MulticastAttributes.Protected|MulticastAttributes.Internal|MulticastAttributes.InternalAndProtected|MulticastAttributes.InternalOrProtected|MulticastAttributes.Public|MulticastAttributes.AnyVisibility|MulticastAttributes.Static|MulticastAttributes.Instance|MulticastAttributes.AnyScope|MulticastAttributes.NonAbstract|MulticastAttributes.Managed, 
	AllowMultiple = true)]
public abstract class OnExceptionAspect : ExceptionHandlerAspect, IOnExceptionAspect, 
	IExceptionHandlerAspect, ILaosMethodLevelAspect, ILaosWeavableAspect, IInstanceBoundLaosAspect, ILaosAspect
Visual C++
[SerializableAttribute]
[AttributeUsageAttribute(AttributeTargets::Assembly|AttributeTargets::Class|AttributeTargets::Struct|AttributeTargets::Constructor|AttributeTargets::Method|AttributeTargets::Property|AttributeTargets::Event, AllowMultiple = true, 
	Inherited = false)]
[MulticastAttributeUsageAttribute(MulticastTargets::Default|MulticastTargets::Method|MulticastTargets::Constructor, TargetMemberAttributes = MulticastAttributes::Default|MulticastAttributes::Private|MulticastAttributes::Protected|MulticastAttributes::Internal|MulticastAttributes::InternalAndProtected|MulticastAttributes::InternalOrProtected|MulticastAttributes::Public|MulticastAttributes::AnyVisibility|MulticastAttributes::Static|MulticastAttributes::Instance|MulticastAttributes::AnyScope|MulticastAttributes::NonAbstract|MulticastAttributes::Managed, 
	AllowMultiple = true)]
public ref class OnExceptionAspect abstract : public ExceptionHandlerAspect, 
	IOnExceptionAspect, IExceptionHandlerAspect, ILaosMethodLevelAspect, ILaosWeavableAspect, IInstanceBoundLaosAspect, 
	ILaosAspect

Inheritance Hierarchy

System..::.Object
  System..::.Attribute
    PostSharp.Extensibility..::.MulticastAttribute
      PostSharp.Laos..::.LaosAspect
        PostSharp.Laos..::.LaosWeavableAspect
          PostSharp.Laos..::.LaosMethodLevelAspect
            PostSharp.Laos..::.ExceptionHandlerAspect
              PostSharp.Laos..::.OnExceptionAspect

See Also