Exemplo n.º 1
0
        public virtual void HandleError(ApplicationError applicationError)
        {
            applicationError.ResetResponse();

            var httpContextWrapper = new HttpContextWrapper(applicationError.HttpContext);

            var routeData = new RouteData()
                .WithValue("controller", this.GetControllerName())
                .WithValue("action", GetActionName(applicationError.StatusCode))
                .WithValue("exception", applicationError.LastException);

            var requestContext = new RequestContext(httpContextWrapper, routeData);

            ((IController)this).Execute(requestContext);
        }