[Fixes #315] Display LoaderExceptions in ErrorPage

This commit is contained in:
Ajay Bhargav Baaskaran 2016-07-19 11:27:48 -07:00
parent 496d94b41f
commit f7641fa28b
3 changed files with 278 additions and 202 deletions

View File

@ -25,12 +25,18 @@ using System.Net
#line hidden
;
#line 5 "ErrorPage.cshtml"
using Microsoft.AspNetCore.Diagnostics.Views
using System.Reflection
#line default
#line hidden
;
#line 6 "ErrorPage.cshtml"
using Microsoft.AspNetCore.Diagnostics.Views
#line default
#line hidden
;
#line 7 "ErrorPage.cshtml"
using Microsoft.AspNetCore.Diagnostics
#line default
@ -40,7 +46,7 @@ using Microsoft.AspNetCore.Diagnostics
public class ErrorPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView
{
#line 8 "ErrorPage.cshtml"
#line 9 "ErrorPage.cshtml"
public ErrorPage(ErrorPageModel model)
{
@ -59,7 +65,7 @@ using Microsoft.AspNetCore.Diagnostics
#pragma warning disable 1998
public override async Task ExecuteAsync()
{
#line 16 "ErrorPage.cshtml"
#line 17 "ErrorPage.cshtml"
// TODO: Response.ReasonPhrase = "Internal Server Error";
Response.ContentType = "text/html; charset=utf-8";
@ -69,33 +75,33 @@ using Microsoft.AspNetCore.Diagnostics
#line hidden
WriteLiteral("<!DOCTYPE html>\r\n<html");
BeginWriteAttribute("lang", " lang=\"", 505, "\"", 566, 1);
#line 22 "ErrorPage.cshtml"
WriteAttributeValue("", 512, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, 512, 54, false);
BeginWriteAttribute("lang", " lang=\"", 531, "\"", 592, 1);
#line 23 "ErrorPage.cshtml"
WriteAttributeValue("", 538, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, 538, 54, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(" xmlns=\"http://www.w3.org/1999/xhtml\">\r\n <head>\r\n <meta charset=\"utf-8\" />\r\n <title>");
#line 25 "ErrorPage.cshtml"
#line 26 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_Title);
#line default
#line hidden
WriteLiteral("</title>\r\n <style>\r\n body {\r\n font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif;\r\n font-size: .813em;\r\n line-height: 1.4em;\r\n color: #222;\r\n}\r\n\r\nh1, h2, h3, h4, h5 {\r\n /*font-family: 'Segoe UI',Tahoma,Arial,Helvetica,sans-serif;*/\r\n font-weight: 100;\r\n}\r\n\r\nh1 {\r\n color: #44525e;\r\n margin: 15px 0 15px 0;\r\n}\r\n\r\nh2 {\r\n margin: 10px 5px 0 0;\r\n}\r\n\r\nh3 {\r\n color: #363636;\r\n margin: 5px 5px 0 0;\r\n}\r\n\r\ncode {\r\n font-family: Consolas, \"Courier New\", courier, monospace;\r\n}\r\n\r\nbody .titleerror {\r\n padding: 3px 3px 6px 3px;\r\n display: block;\r\n font-size: 1.5em;\r\n font-weight: 100;\r\n}\r\n\r\nbody .location {\r\n margin: 3px 0 10px 30px;\r\n}\r\n\r\n#header {\r\n font-size: 18px;\r\n padding: 15px 0;\r\n border-top: 1px #ddd solid;\r\n border-bottom: 1px #ddd solid;\r\n margin-bottom: 0;\r\n}\r\n\r\n #header li {\r\n display: inline;\r\n margin: 5px;\r\n padding: 5px;\r\n color: #a0a0a0;\r\n cursor: pointer;\r\n }\r\n\r\n #header li:hover {\r\n background: #a9e4f9;\r\n color: #fff;\r\n }\r\n\r\n #header .selected {\r\n background: #44c5f2;\r\n color: #fff;\r\n }\r\n\r\n#stackpage ul {\r\n list-style: none;\r\n padding-left: 0;\r\n margin: 0;\r\n /*border-bottom: 1px #ddd solid;*/\r\n}\r\n\r\n#stackpage .details {\r\n font-size: 1.2em;\r\n padding: 3px;\r\n color: #000;\r\n}\r\n\r\n#stackpage .stackerror {\r\n padding: 5px;\r\n border-bottom: 1px #ddd solid;\r\n}\r\n\r\n #stackpage .stackerror:hover {\r\n background-color: #f0f0f0;\r\n }\r\n\r\n#stackpage .frame:hover {\r\n background-color: #f0f0f0;\r\n text-decoration: none;\r\n}\r\n\r\n#stackpage .frame {\r\n padding: 2px;\r\n margin: 0 0 0 30px;\r\n border-bottom: 1px #ddd solid;\r\n cursor: pointer;\r\n}\r\n\r\n #stackpage .frame h3 {\r\n padding: 5px;\r\n margin: 0;\r\n }\r\n\r\n#stackpage .source {\r\n padding: 0;\r\n}\r\n\r\n #stackpage .source ol li {\r\n font-family: Consolas, \"Courier New\", courier, monospace;\r\n white-space: pre;\r\n }\r\n\r\n#stackpage .frame:hover .source .highlight li span {\r\n color: #fff;\r\n background: #b20000;\r\n}\r\n\r\n#stackpage .source ol.collapsible li {\r\n color: #888;\r\n}\r\n\r\n #stackpage .source ol.collapsible li span {\r\n color: #606060;\r\n }\r\n\r\n.page table {\r\n border-collapse: separate;\r\n border-spacing: 0;\r\n margin: 0 0 20px;\r\n}\r\n\r\n.page th {\r\n vertical-align: bottom;\r\n padding: 10px 5px 5px 5px;\r\n font-weight: 400;\r\n color: #a0a0a0;\r\n text-align: left;\r\n}\r\n\r\n.page td {\r\n padding: 3px 10px;\r\n}\r\n\r\n.page th, .page td {\r\n border-right: 1px #ddd solid;\r\n border-bottom: 1px #ddd solid;\r\n border-left: 1px transparent solid;\r\n border-top: 1px transparent solid;\r\n box-sizing: border-box;\r\n}\r\n\r\n .page th:last-child, .page td:last-child {\r\n border-right: 1px transparent solid;\r\n }\r\n\r\n .page .length {\r\n text-align: right;\r\n }\r\n\r\na {\r\n color: #1ba1e2;\r\n text-decoration: none;\r\n}\r\n\r\n a:hover {\r\n color: #13709e;\r\n text-decoration: underline;\r\n }\r\n\r\n </style>\r\n </head>\r\n <body>\r\n <h1>");
#line 31 "ErrorPage.cshtml"
#line 32 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_UnhandledException);
#line default
#line hidden
WriteLiteral("</h1>\r\n");
#line 32 "ErrorPage.cshtml"
#line 33 "ErrorPage.cshtml"
#line default
#line hidden
#line 32 "ErrorPage.cshtml"
#line 33 "ErrorPage.cshtml"
foreach (var errorDetail in Model.ErrorDetails)
{
@ -103,26 +109,26 @@ WriteAttributeValue("", 512, CultureInfo.CurrentUICulture.TwoLetterISOLanguageNa
#line hidden
WriteLiteral(" <div class=\"titleerror\">");
#line 34 "ErrorPage.cshtml"
#line 35 "ErrorPage.cshtml"
Write(errorDetail.Error.GetType().Name);
#line default
#line hidden
WriteLiteral(": ");
#line 34 "ErrorPage.cshtml"
#line 35 "ErrorPage.cshtml"
Output.Write(HtmlEncodeAndReplaceLineBreaks(errorDetail.Error.Message));
#line default
#line hidden
WriteLiteral("</div>\r\n");
#line 35 "ErrorPage.cshtml"
#line 36 "ErrorPage.cshtml"
#line default
#line hidden
#line 35 "ErrorPage.cshtml"
#line 36 "ErrorPage.cshtml"
var firstFrame = errorDetail.StackFrames.FirstOrDefault();
if (firstFrame != null)
@ -134,7 +140,7 @@ WriteAttributeValue("", 512, CultureInfo.CurrentUICulture.TwoLetterISOLanguageNa
#line default
#line hidden
#line 41 "ErrorPage.cshtml"
#line 42 "ErrorPage.cshtml"
if (!string.IsNullOrEmpty(location) && firstFrame != null && !string.IsNullOrEmpty(firstFrame.File))
{
@ -142,34 +148,34 @@ WriteAttributeValue("", 512, CultureInfo.CurrentUICulture.TwoLetterISOLanguageNa
#line default
#line hidden
WriteLiteral(" <p class=\"location\">");
#line 44 "ErrorPage.cshtml"
Write(location);
WriteLiteral(" <p class=\"location\">");
#line 45 "ErrorPage.cshtml"
Write(location);
#line default
#line hidden
WriteLiteral(" in <code");
BeginWriteAttribute("title", " title=\"", 1520, "\"", 1544, 1);
#line 44 "ErrorPage.cshtml"
WriteAttributeValue("", 1528, firstFrame.File, 1528, 16, false);
BeginWriteAttribute("title", " title=\"", 1542, "\"", 1566, 1);
#line 45 "ErrorPage.cshtml"
WriteAttributeValue("", 1550, firstFrame.File, 1550, 16, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(">");
#line 44 "ErrorPage.cshtml"
Write(System.IO.Path.GetFileName(firstFrame.File));
#line 45 "ErrorPage.cshtml"
Write(System.IO.Path.GetFileName(firstFrame.File));
#line default
#line hidden
WriteLiteral("</code>, line ");
#line 44 "ErrorPage.cshtml"
Write(firstFrame.Line);
#line 45 "ErrorPage.cshtml"
Write(firstFrame.Line);
#line default
#line hidden
WriteLiteral("</p>\r\n");
#line 45 "ErrorPage.cshtml"
#line 46 "ErrorPage.cshtml"
}
else if (!string.IsNullOrEmpty(location))
{
@ -177,14 +183,14 @@ WriteAttributeValue("", 1528, firstFrame.File, 1528, 16, false);
#line default
#line hidden
WriteLiteral(" <p class=\"location\">");
#line 48 "ErrorPage.cshtml"
Write(location);
WriteLiteral(" <p class=\"location\">");
#line 49 "ErrorPage.cshtml"
Write(location);
#line default
#line hidden
WriteLiteral("</p>\r\n");
#line 49 "ErrorPage.cshtml"
#line 50 "ErrorPage.cshtml"
}
else
{
@ -192,59 +198,113 @@ WriteAttributeValue("", 1528, firstFrame.File, 1528, 16, false);
#line default
#line hidden
WriteLiteral(" <p class=\"location\">");
#line 52 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_UnknownLocation);
WriteLiteral(" <p class=\"location\">");
#line 53 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_UnknownLocation);
#line default
#line hidden
WriteLiteral("</p>\r\n");
#line 53 "ErrorPage.cshtml"
#line 54 "ErrorPage.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" ");
#line 56 "ErrorPage.cshtml"
var reflectionTypeLoadException = Model.ErrorDetails.Last()?.Error as ReflectionTypeLoadException;
if (reflectionTypeLoadException != null)
{
if (reflectionTypeLoadException.LoaderExceptions.Length > 0)
{
#line default
#line hidden
WriteLiteral(" <h3>LoaderExceptions:</h3>\r\n");
#line 63 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" <ul>\r\n");
#line 65 "ErrorPage.cshtml"
#line default
#line hidden
#line 65 "ErrorPage.cshtml"
foreach (var ex in reflectionTypeLoadException.LoaderExceptions)
{
#line default
#line hidden
WriteLiteral(" <li>");
#line 67 "ErrorPage.cshtml"
Write(ex.Message);
#line default
#line hidden
WriteLiteral("</li>\r\n");
#line 68 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ul>\r\n");
#line 70 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" <ul id=\"header\">\r\n <li id=\"stack\" tabindex=\"1\" class=\"selected\">\r\n ");
#line 57 "ErrorPage.cshtml"
#line 74 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_StackButton);
#line default
#line hidden
WriteLiteral("\r\n </li>\r\n <li id=\"query\" tabindex=\"2\">\r\n ");
#line 60 "ErrorPage.cshtml"
#line 77 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_QueryButton);
#line default
#line hidden
WriteLiteral("\r\n </li>\r\n <li id=\"cookies\" tabindex=\"3\">\r\n ");
#line 63 "ErrorPage.cshtml"
#line 80 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_CookiesButton);
#line default
#line hidden
WriteLiteral("\r\n </li>\r\n <li id=\"headers\" tabindex=\"4\">\r\n ");
#line 66 "ErrorPage.cshtml"
#line 83 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_HeadersButton);
#line default
#line hidden
WriteLiteral("\r\n </li>\r\n </ul>\r\n\r\n <div id=\"stackpage\" class=\"page\">\r\n <ul>\r\n");
#line 72 "ErrorPage.cshtml"
#line 89 "ErrorPage.cshtml"
#line default
#line hidden
#line 72 "ErrorPage.cshtml"
#line 89 "ErrorPage.cshtml"
int tabIndex = 6;
#line default
#line hidden
WriteLiteral(" ");
#line 73 "ErrorPage.cshtml"
#line 90 "ErrorPage.cshtml"
foreach (var errorDetail in Model.ErrorDetails)
{
@ -252,25 +312,25 @@ WriteAttributeValue("", 1528, firstFrame.File, 1528, 16, false);
#line hidden
WriteLiteral(" <li>\r\n <h2 class=\"stackerror\">");
#line 76 "ErrorPage.cshtml"
#line 93 "ErrorPage.cshtml"
Write(errorDetail.Error.GetType().Name);
#line default
#line hidden
WriteLiteral(": ");
#line 76 "ErrorPage.cshtml"
#line 93 "ErrorPage.cshtml"
Write(errorDetail.Error.Message);
#line default
#line hidden
WriteLiteral("</h2>\r\n <ul>\r\n");
#line 78 "ErrorPage.cshtml"
#line 95 "ErrorPage.cshtml"
#line default
#line hidden
#line 78 "ErrorPage.cshtml"
#line 95 "ErrorPage.cshtml"
foreach (var frame in errorDetail.StackFrames)
{
@ -278,28 +338,28 @@ WriteAttributeValue("", 1528, firstFrame.File, 1528, 16, false);
#line hidden
WriteLiteral(" <li class=\"frame\"");
BeginWriteAttribute("tabindex", " tabindex=\"", 2948, "\"", 2968, 1);
#line 80 "ErrorPage.cshtml"
WriteAttributeValue("", 2959, tabIndex, 2959, 9, false);
BeginWriteAttribute("tabindex", " tabindex=\"", 3570, "\"", 3590, 1);
#line 97 "ErrorPage.cshtml"
WriteAttributeValue("", 3581, tabIndex, 3581, 9, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(">\r\n");
#line 81 "ErrorPage.cshtml"
#line 98 "ErrorPage.cshtml"
#line default
#line hidden
#line 81 "ErrorPage.cshtml"
#line 98 "ErrorPage.cshtml"
tabIndex++;
#line default
#line hidden
WriteLiteral(" ");
#line 82 "ErrorPage.cshtml"
#line 99 "ErrorPage.cshtml"
if (string.IsNullOrEmpty(frame.File))
{
@ -307,13 +367,13 @@ WriteAttributeValue("", 2959, tabIndex, 2959, 9, false);
#line hidden
WriteLiteral(" <h3>");
#line 84 "ErrorPage.cshtml"
#line 101 "ErrorPage.cshtml"
Write(frame.Function);
#line default
#line hidden
WriteLiteral("</h3>\r\n");
#line 85 "ErrorPage.cshtml"
#line 102 "ErrorPage.cshtml"
}
else
{
@ -322,40 +382,40 @@ WriteAttributeValue("", 2959, tabIndex, 2959, 9, false);
#line hidden
WriteLiteral(" <h3>");
#line 88 "ErrorPage.cshtml"
#line 105 "ErrorPage.cshtml"
Write(frame.Function);
#line default
#line hidden
WriteLiteral(" in <code");
BeginWriteAttribute("title", " title=\"", 3363, "\"", 3382, 1);
#line 88 "ErrorPage.cshtml"
WriteAttributeValue("", 3371, frame.File, 3371, 11, false);
BeginWriteAttribute("title", " title=\"", 3985, "\"", 4004, 1);
#line 105 "ErrorPage.cshtml"
WriteAttributeValue("", 3993, frame.File, 3993, 11, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(">");
#line 88 "ErrorPage.cshtml"
#line 105 "ErrorPage.cshtml"
Write(System.IO.Path.GetFileName(frame.File));
#line default
#line hidden
WriteLiteral("</code></h3>\r\n");
#line 89 "ErrorPage.cshtml"
#line 106 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n");
#line 91 "ErrorPage.cshtml"
#line 108 "ErrorPage.cshtml"
#line default
#line hidden
#line 91 "ErrorPage.cshtml"
#line 108 "ErrorPage.cshtml"
if (frame.Line != 0 && frame.ContextCode.Any())
{
@ -363,13 +423,13 @@ WriteAttributeValue("", 3371, frame.File, 3371, 11, false);
#line hidden
WriteLiteral(" <div class=\"source\">\r\n");
#line 94 "ErrorPage.cshtml"
#line 111 "ErrorPage.cshtml"
#line default
#line hidden
#line 94 "ErrorPage.cshtml"
#line 111 "ErrorPage.cshtml"
if (frame.PreContextCode.Any())
{
@ -377,100 +437,9 @@ WriteAttributeValue("", 3371, frame.File, 3371, 11, false);
#line hidden
WriteLiteral(" <ol");
BeginWriteAttribute("start", " start=\"", 3813, "\"", 3842, 1);
#line 96 "ErrorPage.cshtml"
WriteAttributeValue("", 3821, frame.PreContextLine, 3821, 21, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(" class=\"collapsible\">\r\n");
#line 97 "ErrorPage.cshtml"
#line default
#line hidden
#line 97 "ErrorPage.cshtml"
foreach (var line in frame.PreContextCode)
{
#line default
#line hidden
WriteLiteral(" <li><span>");
#line 99 "ErrorPage.cshtml"
Write(line);
#line default
#line hidden
WriteLiteral("</span></li>\r\n");
#line 100 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ol>\r\n");
#line 102 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n <ol");
BeginWriteAttribute("start", " start=\"", 4281, "\"", 4300, 1);
#line 104 "ErrorPage.cshtml"
WriteAttributeValue("", 4289, frame.Line, 4289, 11, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(" class=\"highlight\">\r\n");
#line 105 "ErrorPage.cshtml"
#line default
#line hidden
#line 105 "ErrorPage.cshtml"
foreach (var line in frame.ContextCode)
{
#line default
#line hidden
WriteLiteral(" <li><span>");
#line 107 "ErrorPage.cshtml"
Write(line);
#line default
#line hidden
WriteLiteral("</span></li>\r\n");
#line 108 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ol>\r\n\r\n");
#line 111 "ErrorPage.cshtml"
#line default
#line hidden
#line 111 "ErrorPage.cshtml"
if (frame.PostContextCode.Any())
{
#line default
#line hidden
WriteLiteral(" <ol");
BeginWriteAttribute("start", " start=\'", 4793, "\'", 4818, 1);
BeginWriteAttribute("start", " start=\"", 4435, "\"", 4464, 1);
#line 113 "ErrorPage.cshtml"
WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
WriteAttributeValue("", 4443, frame.PreContextLine, 4443, 21, false);
#line default
#line hidden
@ -483,7 +452,7 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line hidden
#line 114 "ErrorPage.cshtml"
foreach (var line in frame.PostContextCode)
foreach (var line in frame.PreContextCode)
{
#line default
@ -509,15 +478,106 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line default
#line hidden
WriteLiteral(" </div>\r\n");
WriteLiteral("\r\n <ol");
BeginWriteAttribute("start", " start=\"", 4903, "\"", 4922, 1);
#line 121 "ErrorPage.cshtml"
WriteAttributeValue("", 4911, frame.Line, 4911, 11, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(" class=\"highlight\">\r\n");
#line 122 "ErrorPage.cshtml"
#line default
#line hidden
#line 122 "ErrorPage.cshtml"
foreach (var line in frame.ContextCode)
{
#line default
#line hidden
WriteLiteral(" <li><span>");
#line 124 "ErrorPage.cshtml"
Write(line);
#line default
#line hidden
WriteLiteral("</span></li>\r\n");
#line 125 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ol>\r\n\r\n");
#line 128 "ErrorPage.cshtml"
#line default
#line hidden
#line 128 "ErrorPage.cshtml"
if (frame.PostContextCode.Any())
{
#line default
#line hidden
WriteLiteral(" <ol");
BeginWriteAttribute("start", " start=\'", 5415, "\'", 5440, 1);
#line 130 "ErrorPage.cshtml"
WriteAttributeValue("", 5423, frame.Line + 1, 5423, 17, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(" class=\"collapsible\">\r\n");
#line 131 "ErrorPage.cshtml"
#line default
#line hidden
#line 131 "ErrorPage.cshtml"
foreach (var line in frame.PostContextCode)
{
#line default
#line hidden
WriteLiteral(" <li><span>");
#line 133 "ErrorPage.cshtml"
Write(line);
#line default
#line hidden
WriteLiteral("</span></li>\r\n");
#line 134 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ol>\r\n");
#line 136 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
#line 138 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </li>\r\n");
#line 123 "ErrorPage.cshtml"
#line 140 "ErrorPage.cshtml"
}
#line default
@ -533,26 +593,26 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
</div>
<div id=""rawException"" style=""display:none"">
<pre>");
#line 133 "ErrorPage.cshtml"
#line 150 "ErrorPage.cshtml"
Write(errorDetail.Error.ToString());
#line default
#line hidden
WriteLiteral("</pre>\r\n </div>\r\n </div>\r\n </li>\r\n");
#line 137 "ErrorPage.cshtml"
#line 154 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ul>\r\n </div>\r\n\r\n <div id=\"querypage\" class=\"page\">\r\n");
#line 142 "ErrorPage.cshtml"
#line 159 "ErrorPage.cshtml"
#line default
#line hidden
#line 142 "ErrorPage.cshtml"
#line 159 "ErrorPage.cshtml"
if (Model.Query.Any())
{
@ -560,25 +620,25 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line hidden
WriteLiteral(" <table>\r\n <thead>\r\n <tr>\r\n <th>");
#line 147 "ErrorPage.cshtml"
#line 164 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_VariableColumn);
#line default
#line hidden
WriteLiteral("</th>\r\n <th>");
#line 148 "ErrorPage.cshtml"
#line 165 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_ValueColumn);
#line default
#line hidden
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n");
#line 152 "ErrorPage.cshtml"
#line 169 "ErrorPage.cshtml"
#line default
#line hidden
#line 152 "ErrorPage.cshtml"
#line 169 "ErrorPage.cshtml"
foreach (var kv in Model.Query.OrderBy(kv => kv.Key))
{
foreach (var v in kv.Value)
@ -588,19 +648,19 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line hidden
WriteLiteral(" <tr>\r\n <td>");
#line 157 "ErrorPage.cshtml"
#line 174 "ErrorPage.cshtml"
Write(kv.Key);
#line default
#line hidden
WriteLiteral("</td>\r\n <td>");
#line 158 "ErrorPage.cshtml"
#line 175 "ErrorPage.cshtml"
Write(v);
#line default
#line hidden
WriteLiteral("</td>\r\n </tr>\r\n");
#line 160 "ErrorPage.cshtml"
#line 177 "ErrorPage.cshtml"
}
}
@ -608,7 +668,7 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line hidden
WriteLiteral(" </tbody>\r\n </table>\r\n");
#line 164 "ErrorPage.cshtml"
#line 181 "ErrorPage.cshtml"
}
else
{
@ -617,26 +677,26 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line hidden
WriteLiteral(" <p>");
#line 167 "ErrorPage.cshtml"
#line 184 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_NoQueryStringData);
#line default
#line hidden
WriteLiteral("</p>\r\n");
#line 168 "ErrorPage.cshtml"
#line 185 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n\r\n <div id=\"cookiespage\" class=\"page\">\r\n");
#line 172 "ErrorPage.cshtml"
#line 189 "ErrorPage.cshtml"
#line default
#line hidden
#line 172 "ErrorPage.cshtml"
#line 189 "ErrorPage.cshtml"
if (Model.Cookies.Any())
{
@ -644,25 +704,25 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line hidden
WriteLiteral(" <table>\r\n <thead>\r\n <tr>\r\n <th>");
#line 177 "ErrorPage.cshtml"
#line 194 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_VariableColumn);
#line default
#line hidden
WriteLiteral("</th>\r\n <th>");
#line 178 "ErrorPage.cshtml"
#line 195 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_ValueColumn);
#line default
#line hidden
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n");
#line 182 "ErrorPage.cshtml"
#line 199 "ErrorPage.cshtml"
#line default
#line hidden
#line 182 "ErrorPage.cshtml"
#line 199 "ErrorPage.cshtml"
foreach (var kv in Model.Cookies.OrderBy(kv => kv.Key))
{
@ -670,26 +730,26 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line hidden
WriteLiteral(" <tr>\r\n <td>");
#line 185 "ErrorPage.cshtml"
#line 202 "ErrorPage.cshtml"
Write(kv.Key);
#line default
#line hidden
WriteLiteral("</td>\r\n <td>");
#line 186 "ErrorPage.cshtml"
#line 203 "ErrorPage.cshtml"
Write(kv.Value);
#line default
#line hidden
WriteLiteral("</td>\r\n </tr>\r\n");
#line 188 "ErrorPage.cshtml"
#line 205 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </tbody>\r\n </table>\r\n");
#line 191 "ErrorPage.cshtml"
#line 208 "ErrorPage.cshtml"
}
else
{
@ -698,26 +758,26 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line hidden
WriteLiteral(" <p>");
#line 194 "ErrorPage.cshtml"
#line 211 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_NoCookieData);
#line default
#line hidden
WriteLiteral("</p>\r\n");
#line 195 "ErrorPage.cshtml"
#line 212 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n <div id=\"headerspage\" class=\"page\">\r\n");
#line 198 "ErrorPage.cshtml"
#line 215 "ErrorPage.cshtml"
#line default
#line hidden
#line 198 "ErrorPage.cshtml"
#line 215 "ErrorPage.cshtml"
if (Model.Headers.Any())
{
@ -725,25 +785,25 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line hidden
WriteLiteral(" <table>\r\n <thead>\r\n <tr>\r\n <th>");
#line 203 "ErrorPage.cshtml"
#line 220 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_VariableColumn);
#line default
#line hidden
WriteLiteral("</th>\r\n <th>");
#line 204 "ErrorPage.cshtml"
#line 221 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_ValueColumn);
#line default
#line hidden
WriteLiteral("</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n");
#line 208 "ErrorPage.cshtml"
#line 225 "ErrorPage.cshtml"
#line default
#line hidden
#line 208 "ErrorPage.cshtml"
#line 225 "ErrorPage.cshtml"
foreach (var kv in Model.Headers.OrderBy(kv => kv.Key))
{
foreach (var v in kv.Value)
@ -753,19 +813,19 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line hidden
WriteLiteral(" <tr>\r\n <td>");
#line 213 "ErrorPage.cshtml"
#line 230 "ErrorPage.cshtml"
Write(kv.Key);
#line default
#line hidden
WriteLiteral("</td>\r\n <td>");
#line 214 "ErrorPage.cshtml"
#line 231 "ErrorPage.cshtml"
Write(v);
#line default
#line hidden
WriteLiteral("</td>\r\n </tr>\r\n");
#line 216 "ErrorPage.cshtml"
#line 233 "ErrorPage.cshtml"
}
}
@ -773,7 +833,7 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line hidden
WriteLiteral(" </tbody>\r\n </table>\r\n");
#line 220 "ErrorPage.cshtml"
#line 237 "ErrorPage.cshtml"
}
else
{
@ -782,13 +842,13 @@ WriteAttributeValue("", 4801, frame.Line + 1, 4801, 17, false);
#line hidden
WriteLiteral(" <p>");
#line 223 "ErrorPage.cshtml"
#line 240 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_NoHeaderData);
#line default
#line hidden
WriteLiteral("</p>\r\n");
#line 224 "ErrorPage.cshtml"
#line 241 "ErrorPage.cshtml"
}
#line default

View File

@ -1,7 +1,8 @@
@using System
@using System
@using System.Globalization
@using System.Linq
@using System.Net
@using System.Reflection
@using Microsoft.AspNetCore.Diagnostics.Views
@using Microsoft.AspNetCore.Diagnostics
@functions
@ -41,15 +42,31 @@
}
if (!string.IsNullOrEmpty(location) && firstFrame != null && !string.IsNullOrEmpty(firstFrame.File))
{
<p class="location">@location in <code title="@firstFrame.File">@System.IO.Path.GetFileName(firstFrame.File)</code>, line @firstFrame.Line</p>
<p class="location">@location in <code title="@firstFrame.File">@System.IO.Path.GetFileName(firstFrame.File)</code>, line @firstFrame.Line</p>
}
else if (!string.IsNullOrEmpty(location))
{
<p class="location">@location</p>
<p class="location">@location</p>
}
else
{
<p class="location">@Resources.ErrorPageHtml_UnknownLocation</p>
<p class="location">@Resources.ErrorPageHtml_UnknownLocation</p>
}
}
@{
var reflectionTypeLoadException = Model.ErrorDetails.Last()?.Error as ReflectionTypeLoadException;
if (reflectionTypeLoadException != null)
{
if (reflectionTypeLoadException.LoaderExceptions.Length > 0)
{
<h3>Loader Exceptions:</h3>
<ul>
@foreach (var ex in reflectionTypeLoadException.LoaderExceptions)
{
<li>@ex.Message</li>
}
</ul>
}
}
}
<ul id="header">

View File

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;