에러 처리 HandleErrorAttribute
ExceptionInfo info = new ExceptionInfo();
info.Success = false;
info.Message = filterContext.Exception.Message.ToString();
info.Data = null;
//filterContext.HttpContext.Request.IsAjaxRequest()
filterContext.Result = new JsonResult() { Data =info};
filterContext.ExceptionHandled = true;
filterContext.HttpContext.Response.Clear();
// filterContext.HttpContext.Response.StatusCode = 500;
filterContext.HttpContext.Response.TrySkipIisCustomErrors = true;
FilterConfig에 등록 할것
filters.Add(new HandleErrorAttribute());