protected override ExceptionContext InvokeExceptionFilters(ControllerContext controllerContext, IList<IExceptionFilter> filters, Exception exception)
 {
     try
     {
         var result = base.InvokeExceptionFilters(controllerContext, filters, exception);
         var baseController = controllerContext.Controller as BaseController;
         if (baseController.IsInstance() && exception.IsInstance())
         {
             try
             {
                 result.HttpContext.Response.Headers.Add("X-Error", baseController.Runtime.InstanceId.ToString());
                 result.Exception = baseController.TearDown(exception);
             }
             catch (Exception ex)
             {
                 ex.Log();
                 return result;
             }
         }
         return result;
     }
     catch (Exception ex)
     {
         ex.Log();
         throw;
     }
 }
Example #2
0
 public void SetErrorState(Exception ex)
 {
     if(Handler==null) return;
     if (Handler.ErrorStateSet) return;
     var builder = new StringBuilder();
     GetTrace(builder);
     Handler?.RootTracer?.SetFaileurePathInformation(builder.ToString());
     if (ex.IsInstance())
         Handler?.RootTracer?.SetException(ex);
     Handler.ErrorStateSet = true;
 }