NuGetGallery.ApiController.OnException C# (CSharp) Method

OnException() protected method

protected OnException ( System.Web.Mvc.ExceptionContext filterContext ) : void
filterContext System.Web.Mvc.ExceptionContext
return void
        protected override void OnException(ExceptionContext filterContext)
        {
            filterContext.ExceptionHandled = true;
            var exception = filterContext.Exception;
            var request = filterContext.HttpContext.Request;
            filterContext.Result = new HttpStatusCodeWithBodyResult(HttpStatusCode.InternalServerError, exception.Message, request.IsLocal ? exception.StackTrace : exception.Message);
        }