diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cs b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cs index b53496bc06..64553df388 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cs +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cs @@ -63,7 +63,7 @@ using Microsoft.AspNetCore.Diagnostics #line default #line hidden - WriteLiteral("\r\n \r\n \r\n \r\n

"); + WriteLiteral("\r\n \r\n \r\n \r\n

"); #line 25 "CompilationErrorPage.cshtml" Write(Resources.ErrorPageHtml_CompilationException); @@ -379,7 +379,7 @@ WriteAttributeValue("", 2864, frame.Line + 1, 2864, 17, false); #line default #line hidden - WriteLiteral(" \r\n \r\n\r\n"); + WriteLiteral(" \r\n \r\n\r\n"); } #pragma warning restore 1998 } diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs index f9551701d2..0ab294ef01 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs @@ -88,7 +88,7 @@ WriteAttributeValue("", 538, CultureInfo.CurrentUICulture.TwoLetterISOLanguageNa #line default #line hidden - WriteLiteral("\r\n \r\n \r\n \r\n

"); + WriteLiteral("\r\n \r\n \r\n \r\n

"); #line 32 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_UnhandledException); @@ -292,68 +292,98 @@ WriteAttributeValue("", 1550, firstFrame.File, 1550, 16, false); #line hidden #line 89 "ErrorPage.cshtml" - int tabIndex = 6; + + var exceptionCount = 0; + var stackFrameCount = 0; + var exceptionDetailId = ""; + var frameId = ""; + #line default #line hidden WriteLiteral(" "); -#line 90 "ErrorPage.cshtml" +#line 95 "ErrorPage.cshtml" foreach (var errorDetail in Model.ErrorDetails) { + + +#line default +#line hidden + +#line 97 "ErrorPage.cshtml" + + exceptionCount++; + exceptionDetailId = "exceptionDetail" + exceptionCount; + + +#line default +#line hidden + +#line 100 "ErrorPage.cshtml" + #line default #line hidden WriteLiteral("
  • \r\n

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

    \r\n \r\n \r\n\r\n
    \r\n"); -#line 159 "ErrorPage.cshtml" +#line 172 "ErrorPage.cshtml" #line default #line hidden -#line 159 "ErrorPage.cshtml" +#line 172 "ErrorPage.cshtml" if (Model.Query.Any()) { @@ -614,25 +661,25 @@ WriteAttributeValue("", 5447, frame.Line + 1, 5447, 17, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"); -#line 169 "ErrorPage.cshtml" +#line 182 "ErrorPage.cshtml" #line default #line hidden -#line 169 "ErrorPage.cshtml" +#line 182 "ErrorPage.cshtml" foreach (var kv in Model.Query.OrderBy(kv => kv.Key)) { foreach (var v in kv.Value) @@ -642,19 +689,19 @@ WriteAttributeValue("", 5447, frame.Line + 1, 5447, 17, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 177 "ErrorPage.cshtml" +#line 190 "ErrorPage.cshtml" } } @@ -662,7 +709,7 @@ WriteAttributeValue("", 5447, frame.Line + 1, 5447, 17, false); #line hidden WriteLiteral(" \r\n
    "); -#line 164 "ErrorPage.cshtml" +#line 177 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(""); -#line 165 "ErrorPage.cshtml" +#line 178 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral("
    "); -#line 174 "ErrorPage.cshtml" +#line 187 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(""); -#line 175 "ErrorPage.cshtml" +#line 188 "ErrorPage.cshtml" Write(v); #line default #line hidden WriteLiteral("
    \r\n"); -#line 181 "ErrorPage.cshtml" +#line 194 "ErrorPage.cshtml" } else { @@ -671,26 +718,26 @@ WriteAttributeValue("", 5447, frame.Line + 1, 5447, 17, false); #line hidden WriteLiteral("

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

    \r\n"); -#line 185 "ErrorPage.cshtml" +#line 198 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("
    \r\n\r\n
    \r\n"); -#line 189 "ErrorPage.cshtml" +#line 202 "ErrorPage.cshtml" #line default #line hidden -#line 189 "ErrorPage.cshtml" +#line 202 "ErrorPage.cshtml" if (Model.Cookies.Any()) { @@ -698,25 +745,25 @@ WriteAttributeValue("", 5447, frame.Line + 1, 5447, 17, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"); -#line 199 "ErrorPage.cshtml" +#line 212 "ErrorPage.cshtml" #line default #line hidden -#line 199 "ErrorPage.cshtml" +#line 212 "ErrorPage.cshtml" foreach (var kv in Model.Cookies.OrderBy(kv => kv.Key)) { @@ -724,26 +771,26 @@ WriteAttributeValue("", 5447, frame.Line + 1, 5447, 17, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 205 "ErrorPage.cshtml" +#line 218 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n
    "); -#line 194 "ErrorPage.cshtml" +#line 207 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(""); -#line 195 "ErrorPage.cshtml" +#line 208 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral("
    "); -#line 202 "ErrorPage.cshtml" +#line 215 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(""); -#line 203 "ErrorPage.cshtml" +#line 216 "ErrorPage.cshtml" Write(kv.Value); #line default #line hidden WriteLiteral("
    \r\n"); -#line 208 "ErrorPage.cshtml" +#line 221 "ErrorPage.cshtml" } else { @@ -752,26 +799,26 @@ WriteAttributeValue("", 5447, frame.Line + 1, 5447, 17, false); #line hidden WriteLiteral("

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

    \r\n"); -#line 212 "ErrorPage.cshtml" +#line 225 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("
    \r\n
    \r\n"); -#line 215 "ErrorPage.cshtml" +#line 228 "ErrorPage.cshtml" #line default #line hidden -#line 215 "ErrorPage.cshtml" +#line 228 "ErrorPage.cshtml" if (Model.Headers.Any()) { @@ -779,25 +826,25 @@ WriteAttributeValue("", 5447, frame.Line + 1, 5447, 17, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"); -#line 225 "ErrorPage.cshtml" +#line 238 "ErrorPage.cshtml" #line default #line hidden -#line 225 "ErrorPage.cshtml" +#line 238 "ErrorPage.cshtml" foreach (var kv in Model.Headers.OrderBy(kv => kv.Key)) { foreach (var v in kv.Value) @@ -807,19 +854,19 @@ WriteAttributeValue("", 5447, frame.Line + 1, 5447, 17, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 233 "ErrorPage.cshtml" +#line 246 "ErrorPage.cshtml" } } @@ -827,7 +874,7 @@ WriteAttributeValue("", 5447, frame.Line + 1, 5447, 17, false); #line hidden WriteLiteral(" \r\n
    "); -#line 220 "ErrorPage.cshtml" +#line 233 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(""); -#line 221 "ErrorPage.cshtml" +#line 234 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral("
    "); -#line 230 "ErrorPage.cshtml" +#line 243 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(""); -#line 231 "ErrorPage.cshtml" +#line 244 "ErrorPage.cshtml" Write(v); #line default #line hidden WriteLiteral("
    \r\n"); -#line 237 "ErrorPage.cshtml" +#line 250 "ErrorPage.cshtml" } else { @@ -836,19 +883,19 @@ WriteAttributeValue("", 5447, frame.Line + 1, 5447, 17, false); #line hidden WriteLiteral("

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

    \r\n"); -#line 241 "ErrorPage.cshtml" +#line 254 "ErrorPage.cshtml" } #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.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cshtml b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cshtml index 43d1b876e2..f4392c63e8 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cshtml +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cshtml @@ -86,16 +86,28 @@
      - @{ int tabIndex = 6; } + @{ + var exceptionCount = 0; + var stackFrameCount = 0; + var exceptionDetailId = ""; + var frameId = ""; + } @foreach (var errorDetail in Model.ErrorDetails) { + @{ + exceptionCount++; + exceptionDetailId = "exceptionDetail" + exceptionCount; + }
    • @errorDetail.Error.GetType().Name: @errorDetail.Error.Message

        @foreach (var frame in errorDetail.StackFrames) { -
      • - @{ tabIndex++; } + @{ + stackFrameCount++; + frameId = "frame" + stackFrameCount; + } +
      • @if (string.IsNullOrEmpty(frame.File)) {

        @frame.Function

        @@ -107,6 +119,7 @@ @if (frame.Line != 0 && frame.ContextCode.Any()) { +
        @if (frame.PreContextCode.Any()) { @@ -143,11 +156,11 @@

      • -
        - Show raw exception details +
        +
        -
      • diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.css b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.css index ad5bc90f0f..5ba258dec1 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.css +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.css @@ -54,15 +54,10 @@ body .location { cursor: pointer; } - #header li:hover { - background: #a9e4f9; - color: #fff; - } - - #header .selected { - background: #44c5f2; - color: #fff; - } + #header .selected { + background: #44c5f2; + color: #fff; + } #stackpage ul { list-style: none; @@ -82,39 +77,29 @@ body .location { border-bottom: 1px #ddd solid; } - #stackpage .stackerror:hover { - background-color: #f0f0f0; - } - -#stackpage .frame:hover { - background-color: #f0f0f0; - text-decoration: none; -} #stackpage .frame { - padding: 2px; + padding: 0; margin: 0 0 0 30px; - border-bottom: 1px #ddd solid; - cursor: pointer; } #stackpage .frame h3 { - padding: 5px; + padding: 2px; margin: 0; } #stackpage .source { - padding: 0; + padding: 0 0 0 30px; } #stackpage .source ol li { font-family: Consolas, "Courier New", courier, monospace; white-space: pre; + background-color: #fbfbfb; } -#stackpage .frame:hover .source .highlight li span { - color: #fff; - background: #b20000; +#stackpage .frame .source .highlight li span { + color: #FF0000; } #stackpage .source ol.collapsible li { @@ -155,9 +140,9 @@ body .location { border-right: 1px transparent solid; } - .page .length { - text-align: right; - } +.page .length { + text-align: right; +} a { color: #1ba1e2; @@ -168,3 +153,45 @@ a { color: #13709e; text-decoration: underline; } + +.showRawException { + cursor: pointer; + color: #44c5f2; + background-color: transparent; + font-size: 1.2em; + text-align: left; + text-decoration: none; + display: inline-block; + border: 0; + padding: 0; + outline: none; +} + +.rawExceptionStackTrace { + font-size: 1.2em; +} + +.rawExceptionBlock { + border-top: 1px #ddd solid; + border-bottom: 1px #ddd solid; +} + +.showRawExceptionContainer { + margin-top: 10px; + margin-bottom: 10px; +} + +.expandCollapseButton { + cursor: pointer; + float: left; + height: 16px; + width: 16px; + font-size: 10px; + position: absolute; + left: 10px; + outline: none; + background-color: #eee; + padding: 0; + border: 0; + margin: 0; +} diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.js b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.js index 97949b16f7..3925cfd2f2 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.js +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.js @@ -140,6 +140,17 @@ ns(".source .collapsible", el).toggle(); } + function expandCollapseButton(el) { + var frameId = el.getAttribute("data-frameId"); + frame(document.getElementById(frameId)); + if (el.innerText === "+") { + el.innerText = "-"; + } + else { + el.innerText = "+"; + } + } + function tab(el) { var unselected = ns("#header .selected").removeClass("selected").attr("id"); var selected = ns("#" + el.id).addClass("selected").attr("id"); @@ -148,27 +159,18 @@ ns("#" + selected + "page").show(); } + ns(".rawExceptionDetails").hide(); ns(".collapsible").hide(); ns(".page").hide(); ns("#stackpage").show(); - ns("#rawExceptionButton").click(function (event) { - var div = document.getElementById('rawException'); - div.style.display = 'inline-block'; - div.scrollIntoView(true); - event.preventDefault(); - event.stopPropagation(); - - return false; - }); - - ns(".frame") + ns(".expandCollapseButton") .click(function () { - frame(this); + expandCollapseButton(this); }) .keypress(function (e) { if (e.which === 13) { - frame(this); + expandCollapseButton(this); } }); @@ -181,4 +183,10 @@ tab(this); } }); + + ns(".showRawException") + .click(function () { + var exceptionDetailId = this.getAttribute("data-exceptionDetailId"); + ns("#" + exceptionDetailId).toggle(); + }); })(window); \ No newline at end of file