Esempio n. 1
0
 public override void OnException(ExceptionContext filterContext)
 {
     if (filterContext.HttpContext.Request.IsAjaxRequest() && filterContext.Exception != null)
     {
         filterContext.HttpContext.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
         filterContext.Result = new JsonResult
         {
             JsonRequestBehavior = JsonRequestBehavior.AllowGet,
             Data = _packageManager.CreateResponsePackage(filterContext.Exception)
         };
         filterContext.ExceptionHandled = true;
     }
     else
     {
         base.OnException(filterContext);
     }
 }