Exemplo n.º 1
0
        private void ShowCustomErrorPage(Exception exception)
        {
            HttpException httpException = exception as HttpException;

            if (httpException == null)
            {
                httpException = new HttpException(500, "Internal Server Error", exception);
            }

            RouteData routeData = new RouteData();

            Log.Error(httpException);
            routeData.Values.Add("controller", "Page");
            routeData.Values.Add("area", "Core");
            routeData.Values.Add("action", "ServerError");
            Server.ClearError();
            IController controller = new Sdl.Web.Mvc.Controllers.PageController();

            controller.Execute(new RequestContext(new HttpContextWrapper(Context), routeData));
        }
        private void ShowCustomErrorPage(Exception exception)
        {
            HttpException httpException = exception as HttpException;
            if (httpException == null)
            {
                httpException = new HttpException(500, "Internal Server Error", exception);
            }

            RouteData routeData = new RouteData();
            Log.Error(httpException);
            routeData.Values.Add("controller", "Page");
            routeData.Values.Add("area", "Core");
            routeData.Values.Add("action", "ServerError");
            Server.ClearError();
            IController controller = new Sdl.Web.Mvc.Controllers.PageController();
            controller.Execute(new RequestContext(new HttpContextWrapper(Context), routeData));
        }