private Task DisplayRuntimeException(HttpContext context, Exception ex)
        {
            var request = context.Request;

            var model = new ErrorPageModel
            {
                Options = _options,
                ErrorDetails = GetErrorDetails(ex).Reverse(),
                Query = request.Query,
                Cookies = request.Cookies,
                Headers = request.Headers
            };

            var errorPage = new ErrorPage(model);
            return errorPage.ExecuteAsync(context);
        }
예제 #2
0
        private Task DisplayRuntimeException(HttpContext context, Exception ex)
        {
            var request = context.Request;

            ErrorPageModel model = new ErrorPageModel()
            {
                Options = _options,
            };

            if (_options.ShowExceptionDetails)
            {
                model.ErrorDetails = GetErrorDetails(ex, _options.ShowSourceCode).Reverse();
            }
            if (_options.ShowQuery)
            {
                model.Query = request.Query;
            }/* TODO:
            if (_options.ShowCookies)
            {
                model.Cookies = request.Cookies;
            }*/
            if (_options.ShowHeaders)
            {
                model.Headers = request.Headers;
            }/* TODO:
            if (_options.ShowEnvironment)
            {
                model.Environment = context;
            }*/

            var errorPage = new ErrorPage(model);
            return errorPage.ExecuteAsync(context);
        }