Yes, Unity Interception (AOP) is a great way to handle exception handling. You can add all kinds of behavior, for example:
- write to a log file or event log
- send email
- increase performance counter
- automatic restart by timeout or blocking exception
- repeat another mistake.
Your call handler will look something like this:
public override IMethodReturn Invoke(IMethodInvocation input, GetNextHandlerDelegate getNext) { IMethodReturn result = getNext()(input, getNext); if (result.Exception != null) {
source share