/// <summary> /// Set General Exception /// </summary> private void SetGeneralExceptionApplicationResponse(HttpActionExecutedContext filterContext) { ISTExceptionContent contents = new ISTExceptionContent { Message = string.IsNullOrEmpty(filterContext.Exception.Message) ? Resources.GeneralErrors.ErrorPerformingOperation : filterContext.Exception.Message }; filterContext.Response = new HttpResponseMessage { StatusCode = System.Net.HttpStatusCode.BadRequest, Content = new StringContent(JsonConvert.SerializeObject(contents)) }; }
/// <summary> /// Set status code and contents of the Application exception /// </summary> private void SetApplicationResponse(HttpActionExecutedContext filterContext) { ISTExceptionContent contents = new ISTExceptionContent { Message = filterContext.Exception.Message }; filterContext.Response = new HttpResponseMessage { StatusCode = System.Net.HttpStatusCode.BadRequest, Content = new StringContent(JsonConvert.SerializeObject(contents)) }; }