// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; using DotNetGuru.AspectDNG.Joinpoints; public class Error { [AroundCall("* IntMath::*(*)")] [AroundCall("* DoubleMath::*(*)")] public static object MathError(MethodJoinPoint mjp) { try { return mjp.Proceed(); } catch(Exception e) { Console.WriteLine("Exception in math calculation ---- " + e.Message); throw e; } } }