From 26a6b5dc33304c5fbb248de514539d6f6f15d902 Mon Sep 17 00:00:00 2001 From: Chris R Date: Tue, 30 Jun 2015 17:05:42 -0700 Subject: [PATCH] #28 Remove environment page from the error page. --- .../ErrorPageMiddleware.cs | 4 - .../Properties/Resources.Designer.cs | 16 -- .../Resources.resx | 4 - .../Views/ErrorPage.cs | 217 +++++++----------- .../Views/ErrorPage.cshtml | 27 --- 5 files changed, 87 insertions(+), 181 deletions(-) diff --git a/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs b/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs index 689090976a..62418b58cf 100644 --- a/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs +++ b/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs @@ -132,10 +132,6 @@ namespace Microsoft.AspNet.Diagnostics Cookies = request.Cookies, Headers = request.Headers }; - - /* TODO: - model.Environment = context; - */ var errorPage = new ErrorPage(model); return errorPage.ExecuteAsync(context); diff --git a/src/Microsoft.AspNet.Diagnostics/Properties/Resources.Designer.cs b/src/Microsoft.AspNet.Diagnostics/Properties/Resources.Designer.cs index ed45925cb7..48c35f0b03 100644 --- a/src/Microsoft.AspNet.Diagnostics/Properties/Resources.Designer.cs +++ b/src/Microsoft.AspNet.Diagnostics/Properties/Resources.Designer.cs @@ -90,22 +90,6 @@ namespace Microsoft.AspNet.Diagnostics return GetString("ErrorPageHtml_CookiesButton"); } - /// - /// Environment - /// - internal static string ErrorPageHtml_EnvironmentButton - { - get { return GetString("ErrorPageHtml_EnvironmentButton"); } - } - - /// - /// Environment - /// - internal static string FormatErrorPageHtml_EnvironmentButton() - { - return GetString("ErrorPageHtml_EnvironmentButton"); - } - /// /// Headers /// diff --git a/src/Microsoft.AspNet.Diagnostics/Resources.resx b/src/Microsoft.AspNet.Diagnostics/Resources.resx index fd50291b12..7c23c72081 100644 --- a/src/Microsoft.AspNet.Diagnostics/Resources.resx +++ b/src/Microsoft.AspNet.Diagnostics/Resources.resx @@ -133,10 +133,6 @@ Cookies as in http request cookies - - Environment - as in environment dictionary - Headers as in http request headers diff --git a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs index a84a8db150..99384d7320 100644 --- a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs +++ b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs @@ -224,37 +224,30 @@ using Views #line 72 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_HeadersButton); -#line default -#line hidden - WriteLiteral("\r\n \r\n
  • \r\n " + -" "); -#line 75 "ErrorPage.cshtml" - Write(Resources.ErrorPageHtml_EnvironmentButton); - #line default #line hidden WriteLiteral("\r\n
  • \r\n \r\n \r\n
    \r\n
      \r\n"); -#line 81 "ErrorPage.cshtml" +#line 78 "ErrorPage.cshtml" #line default #line hidden -#line 81 "ErrorPage.cshtml" +#line 78 "ErrorPage.cshtml" int tabIndex = 6; #line default #line hidden WriteLiteral("\r\n"); -#line 82 "ErrorPage.cshtml" +#line 79 "ErrorPage.cshtml" #line default #line hidden -#line 82 "ErrorPage.cshtml" +#line 79 "ErrorPage.cshtml" foreach (var errorDetail in Model.ErrorDetails) { @@ -262,25 +255,25 @@ using Views #line hidden WriteLiteral("
    • \r\n

      "); -#line 85 "ErrorPage.cshtml" +#line 82 "ErrorPage.cshtml" Write(errorDetail.Error.GetType().Name); #line default #line hidden WriteLiteral(": "); -#line 85 "ErrorPage.cshtml" +#line 82 "ErrorPage.cshtml" Write(errorDetail.Error.Message); #line default #line hidden WriteLiteral("

      \r\n
        \r\n"); -#line 87 "ErrorPage.cshtml" +#line 84 "ErrorPage.cshtml" #line default #line hidden -#line 87 "ErrorPage.cshtml" +#line 84 "ErrorPage.cshtml" foreach (var frame in errorDetail.StackFrames) { @@ -288,29 +281,29 @@ using Views #line hidden WriteLiteral("
      • (tabIndex, 3465), false)); + WriteAttribute("tabindex", Tuple.Create(" tabindex=\"", 3327), Tuple.Create("\"", 3347), + Tuple.Create(Tuple.Create("", 3338), Tuple.Create(tabIndex, 3338), false)); WriteLiteral(">\r\n"); -#line 90 "ErrorPage.cshtml" +#line 87 "ErrorPage.cshtml" #line default #line hidden -#line 90 "ErrorPage.cshtml" +#line 87 "ErrorPage.cshtml" tabIndex++; #line default #line hidden WriteLiteral("\r\n"); -#line 91 "ErrorPage.cshtml" +#line 88 "ErrorPage.cshtml" #line default #line hidden -#line 91 "ErrorPage.cshtml" +#line 88 "ErrorPage.cshtml" if (string.IsNullOrEmpty(frame.File)) { @@ -318,13 +311,13 @@ using Views #line hidden WriteLiteral("

        "); -#line 93 "ErrorPage.cshtml" +#line 90 "ErrorPage.cshtml" Write(frame.Function); #line default #line hidden WriteLiteral("

        \r\n"); -#line 94 "ErrorPage.cshtml" +#line 91 "ErrorPage.cshtml" } else { @@ -333,35 +326,35 @@ using Views #line hidden WriteLiteral("

        "); -#line 97 "ErrorPage.cshtml" +#line 94 "ErrorPage.cshtml" Write(frame.Function); #line default #line hidden WriteLiteral(" in (frame.File, 3877), false)); + WriteAttribute("title", Tuple.Create(" title=\"", 3742), Tuple.Create("\"", 3761), + Tuple.Create(Tuple.Create("", 3750), Tuple.Create(frame.File, 3750), false)); WriteLiteral(">"); -#line 97 "ErrorPage.cshtml" +#line 94 "ErrorPage.cshtml" Write(System.IO.Path.GetFileName(frame.File)); #line default #line hidden WriteLiteral("

        \r\n"); -#line 98 "ErrorPage.cshtml" +#line 95 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("\r\n"); -#line 100 "ErrorPage.cshtml" +#line 97 "ErrorPage.cshtml" #line default #line hidden -#line 100 "ErrorPage.cshtml" +#line 97 "ErrorPage.cshtml" if (frame.Line != 0 && frame.ContextCode.Any()) { @@ -369,13 +362,13 @@ using Views #line hidden WriteLiteral("
        \r\n"); -#line 103 "ErrorPage.cshtml" +#line 100 "ErrorPage.cshtml" #line default #line hidden -#line 103 "ErrorPage.cshtml" +#line 100 "ErrorPage.cshtml" if (frame.PreContextCode != null) { @@ -383,16 +376,16 @@ using Views #line hidden WriteLiteral(" (frame.PreContextLine, 4329), false)); + WriteAttribute("start", Tuple.Create(" start=\"", 4194), Tuple.Create("\"", 4223), + Tuple.Create(Tuple.Create("", 4202), Tuple.Create(frame.PreContextLine, 4202), false)); WriteLiteral(" class=\"collapsible\">\r\n"); -#line 106 "ErrorPage.cshtml" +#line 103 "ErrorPage.cshtml" #line default #line hidden -#line 106 "ErrorPage.cshtml" +#line 103 "ErrorPage.cshtml" foreach (var line in frame.PreContextCode) { @@ -400,36 +393,36 @@ using Views #line hidden WriteLiteral("
      • "); -#line 108 "ErrorPage.cshtml" +#line 105 "ErrorPage.cshtml" Write(line); #line default #line hidden WriteLiteral("
      • \r\n"); -#line 109 "ErrorPage.cshtml" +#line 106 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); -#line 111 "ErrorPage.cshtml" +#line 108 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("\r\n (frame.Line, 4798), false)); + WriteAttribute("start", Tuple.Create(" start=\"", 4663), Tuple.Create("\"", 4682), + Tuple.Create(Tuple.Create("", 4671), Tuple.Create(frame.Line, 4671), false)); WriteLiteral(" class=\"highlight\">\r\n"); -#line 114 "ErrorPage.cshtml" +#line 111 "ErrorPage.cshtml" #line default #line hidden -#line 114 "ErrorPage.cshtml" +#line 111 "ErrorPage.cshtml" foreach (var line in frame.ContextCode) { @@ -437,26 +430,26 @@ using Views #line hidden WriteLiteral("
      • "); -#line 116 "ErrorPage.cshtml" +#line 113 "ErrorPage.cshtml" Write(line); #line default #line hidden WriteLiteral("
      • \r\n"); -#line 117 "ErrorPage.cshtml" +#line 114 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n\r\n"); -#line 120 "ErrorPage.cshtml" +#line 117 "ErrorPage.cshtml" #line default #line hidden -#line 120 "ErrorPage.cshtml" +#line 117 "ErrorPage.cshtml" if (frame.PostContextCode != null) { @@ -464,16 +457,16 @@ using Views #line hidden WriteLiteral(" (frame.Line + 1, 5312), false)); + WriteAttribute("start", Tuple.Create(" start=\'", 5177), Tuple.Create("\'", 5202), + Tuple.Create(Tuple.Create("", 5185), Tuple.Create(frame.Line + 1, 5185), false)); WriteLiteral(" class=\"collapsible\">\r\n"); -#line 123 "ErrorPage.cshtml" +#line 120 "ErrorPage.cshtml" #line default #line hidden -#line 123 "ErrorPage.cshtml" +#line 120 "ErrorPage.cshtml" foreach (var line in frame.PostContextCode) { @@ -481,41 +474,41 @@ using Views #line hidden WriteLiteral("
      • "); -#line 125 "ErrorPage.cshtml" +#line 122 "ErrorPage.cshtml" Write(line); #line default #line hidden WriteLiteral("
      • \r\n"); -#line 126 "ErrorPage.cshtml" +#line 123 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); -#line 128 "ErrorPage.cshtml" +#line 125 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("
    \r\n"); -#line 130 "ErrorPage.cshtml" +#line 127 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); -#line 132 "ErrorPage.cshtml" +#line 129 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n"); -#line 135 "ErrorPage.cshtml" +#line 132 "ErrorPage.cshtml" } #line default @@ -523,13 +516,13 @@ using Views WriteLiteral(" \r\n \r\n \r\n
    \r\n"); -#line 140 "ErrorPage.cshtml" +#line 137 "ErrorPage.cshtml" #line default #line hidden -#line 140 "ErrorPage.cshtml" +#line 137 "ErrorPage.cshtml" if (Model.Query.Any()) { @@ -538,26 +531,26 @@ using Views WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n " + " \r\n"); -#line 150 "ErrorPage.cshtml" +#line 147 "ErrorPage.cshtml" #line default #line hidden -#line 150 "ErrorPage.cshtml" +#line 147 "ErrorPage.cshtml" foreach (var kv in Model.Query.OrderBy(kv => kv.Key)) { foreach (var v in kv.Value) @@ -567,19 +560,19 @@ using Views #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 158 "ErrorPage.cshtml" +#line 155 "ErrorPage.cshtml" } } @@ -587,7 +580,7 @@ using Views #line hidden WriteLiteral(" \r\n
    "); -#line 145 "ErrorPage.cshtml" +#line 142 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(""); -#line 146 "ErrorPage.cshtml" +#line 143 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral("
    "); -#line 155 "ErrorPage.cshtml" +#line 152 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(""); -#line 156 "ErrorPage.cshtml" +#line 153 "ErrorPage.cshtml" Write(v); #line default #line hidden WriteLiteral("
    \r\n"); -#line 162 "ErrorPage.cshtml" +#line 159 "ErrorPage.cshtml" } else { @@ -596,26 +589,26 @@ using Views #line hidden WriteLiteral("

    "); -#line 165 "ErrorPage.cshtml" +#line 162 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_NoQueryStringData); #line default #line hidden WriteLiteral("

    \r\n"); -#line 166 "ErrorPage.cshtml" +#line 163 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("
    \r\n \r\n
    \r\n"); -#line 170 "ErrorPage.cshtml" +#line 167 "ErrorPage.cshtml" #line default #line hidden -#line 170 "ErrorPage.cshtml" +#line 167 "ErrorPage.cshtml" if (Model.Cookies.Any()) { @@ -624,26 +617,26 @@ using Views WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n " + " \r\n"); -#line 180 "ErrorPage.cshtml" +#line 177 "ErrorPage.cshtml" #line default #line hidden -#line 180 "ErrorPage.cshtml" +#line 177 "ErrorPage.cshtml" foreach (var kv in Model.Cookies.OrderBy(kv => kv.Key)) { @@ -651,26 +644,26 @@ using Views #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 186 "ErrorPage.cshtml" +#line 183 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n
    "); -#line 175 "ErrorPage.cshtml" +#line 172 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(""); -#line 176 "ErrorPage.cshtml" +#line 173 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral("
    "); -#line 183 "ErrorPage.cshtml" +#line 180 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(""); -#line 184 "ErrorPage.cshtml" +#line 181 "ErrorPage.cshtml" Write(kv.Value); #line default #line hidden WriteLiteral("
    \r\n"); -#line 189 "ErrorPage.cshtml" +#line 186 "ErrorPage.cshtml" } else { @@ -679,26 +672,26 @@ using Views #line hidden WriteLiteral("

    "); -#line 192 "ErrorPage.cshtml" +#line 189 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_NoCookieData); #line default #line hidden WriteLiteral("

    \r\n"); -#line 193 "ErrorPage.cshtml" +#line 190 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("
    \r\n
    \r\n"); -#line 196 "ErrorPage.cshtml" +#line 193 "ErrorPage.cshtml" #line default #line hidden -#line 196 "ErrorPage.cshtml" +#line 193 "ErrorPage.cshtml" if (Model.Headers.Any()) { @@ -707,26 +700,26 @@ using Views WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n " + " \r\n"); -#line 206 "ErrorPage.cshtml" +#line 203 "ErrorPage.cshtml" #line default #line hidden -#line 206 "ErrorPage.cshtml" +#line 203 "ErrorPage.cshtml" foreach (var kv in Model.Headers.OrderBy(kv => kv.Key)) { foreach (var v in kv.Value) @@ -736,19 +729,19 @@ using Views #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 214 "ErrorPage.cshtml" +#line 211 "ErrorPage.cshtml" } } @@ -756,7 +749,7 @@ using Views #line hidden WriteLiteral(" \r\n
    "); -#line 201 "ErrorPage.cshtml" +#line 198 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(""); -#line 202 "ErrorPage.cshtml" +#line 199 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral("
    "); -#line 211 "ErrorPage.cshtml" +#line 208 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(""); -#line 212 "ErrorPage.cshtml" +#line 209 "ErrorPage.cshtml" Write(v); #line default #line hidden WriteLiteral("
    \r\n"); -#line 218 "ErrorPage.cshtml" +#line 215 "ErrorPage.cshtml" } else { @@ -765,55 +758,19 @@ using Views #line hidden WriteLiteral("

    "); -#line 221 "ErrorPage.cshtml" +#line 218 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_NoHeaderData); #line default #line hidden WriteLiteral("

    \r\n"); -#line 222 "ErrorPage.cshtml" +#line 219 "ErrorPage.cshtml" } #line default #line hidden - WriteLiteral("
    \r\n \r\n"); -#line 225 "ErrorPage.cshtml" - - -#line default -#line hidden - -#line 225 "ErrorPage.cshtml" - - /* TODO: -
    - - - - - - - - - @foreach (var kv in Model.Environment.OrderBy(kv => kv.Key)) - { - - - - - } - -
    @Resources.ErrorPageHtml_VariableColumn@Resources.ErrorPageHtml_ValueColumn
    @kv.Key@kv.Value
    -
    - */ - - -#line default -#line hidden - - WriteLiteral("\r\n \r\n \r\n\r\n"); + WriteLiteral(" \r\n \r\n \r\n\r\n"); } #pragma warning restore 1998 } diff --git a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml index 4687489895..e511c11136 100644 --- a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml +++ b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml @@ -71,9 +71,6 @@
  • @Resources.ErrorPageHtml_HeadersButton
  • -
  • - @Resources.ErrorPageHtml_EnvironmentButton -
  • @@ -221,30 +218,6 @@

    @Resources.ErrorPageHtml_NoHeaderData

    }
    - - @{ - /* TODO: -
    - - - - - - - - - @foreach (var kv in Model.Environment.OrderBy(kv => kv.Key)) - { - - - - - } - -
    @Resources.ErrorPageHtml_VariableColumn@Resources.ErrorPageHtml_ValueColumn
    @kv.Key@kv.Value
    -
    - */ - }