Ejemplo n.º 1
0
        public override void OnException(System.Web.Http.Filters.HttpActionExecutedContext actionExecutedContext)
        {
            base.OnException(actionExecutedContext);

            Exception e = actionExecutedContext.Exception;
            ActionResult result;
            if (e is MSGorillaBaseException)
            {
                result = ((MSGorillaBaseException)e).toActionResult();
            }
            else
            {
                result = new MSGorillaBaseException().toActionResult();
                Trace.TraceError("Server internal error.", e);
            }

            //System.Net.Http.HttpContent
            actionExecutedContext.Response = actionExecutedContext.Request.CreateResponse(HttpStatusCode.BadRequest, result);
        }
Ejemplo n.º 2
0
 public ActionResult(MSGorillaBaseException e)
 {
     ActionResultCode = e.Code;
     Message = e.Message;
 }