// what to do here public override void OnException(MethodArguments arg, Exception e) { //Console.WriteLine($"OnException - {e.Message}"); if (e.GetType() == ExceptionFrom) { // then we rethrow var ctor = ExceptionTo.GetConstructor(new Type[] { ExceptionFrom }); if (ctor == null) { throw e; } var e2 = Convert.ChangeType(ctor.Invoke(new object[] { Convert.ChangeType(e, ExceptionFrom) }), ExceptionTo); throw (Exception)e2; } else { throw e; } }
public override void OnExit(MethodArguments arg) { }
public abstract void OnException(MethodArguments args, Exception e);
public override void OnEntry(MethodArguments arg) { }
public abstract void OnExit(MethodArguments args);
public abstract void OnEntry(MethodArguments args);
public virtual void OnEntry(MethodArguments args) { }
public virtual void OnException(MethodArguments args, Exception e) { }
public virtual void OnExit(MethodArguments args) { }