@errorDetail.Error.GetType().Name: @{ Output.Write(WebUtility.HtmlEncode(errorDetail.Error.Message).Replace("\r\n", "
").Replace("\r", "
").Replace("\n", "
")); }
+ }
+ else
+ {
+
+ @{ int tabIndex = 6; }
+
+
+ @foreach (var frame in errorDetail.StackFrames)
+ {
+ -
+ @{ tabIndex++; }
+ @if (!string.IsNullOrEmpty(frame.ErrorDetails))
+ {
+
@frame.ErrorDetails
+ }
+ else
+ {
+ if (string.IsNullOrEmpty(frame.File))
+ {
+ @frame.Function
+ }
+ else
+ {
+ @frame.Function in @System.IO.Path.GetFileName(frame.File)
+ }
+ }
+ @if (frame.Line != 0 && frame.ContextCode.Any())
+ {
+
+ @if (frame.PreContextCode != null)
+ {
+
+ @foreach (var line in frame.PreContextCode)
+ {
+ - @line
+ }
+
+ }
+
+ @foreach (var line in frame.ContextCode)
+ {
+ - @line
+ }
+
+ @if (frame.PostContextCode != null)
+ {
+
+ @foreach (var line in frame.PostContextCode)
+ {
+ - @line
+ }
+
+ }
+
+ }
+
+ }
+
+
+ }
+
+
+
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs
index a2826d6d32..ecb486deae 100644
--- a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs
+++ b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs
@@ -472,7 +472,7 @@ using Views
#line hidden
#line 123 "ErrorPage.cshtml"
- if (frame.Line != 0 && frame.ContextCode != null)
+ if (frame.Line != 0 && frame.ContextCode.Any())
{
#line default
@@ -493,8 +493,8 @@ using Views
#line hidden
WriteLiteral(" \r\n");
-#line 161 "ErrorPage.cshtml"
+#line 165 "ErrorPage.cshtml"
#line default
#line hidden
-#line 161 "ErrorPage.cshtml"
+#line 165 "ErrorPage.cshtml"
if (Model.Query.Any())
{
@@ -641,26 +662,26 @@ using Views
WriteLiteral("
\r\n \r\n " +
" \r\n | ");
-#line 166 "ErrorPage.cshtml"
+#line 170 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_VariableColumn);
#line default
#line hidden
WriteLiteral(" | \r\n ");
-#line 167 "ErrorPage.cshtml"
+#line 171 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_ValueColumn);
#line default
#line hidden
WriteLiteral(" | \r\n
\r\n \r\n " +
" \r\n");
-#line 171 "ErrorPage.cshtml"
+#line 175 "ErrorPage.cshtml"
#line default
#line hidden
-#line 171 "ErrorPage.cshtml"
+#line 175 "ErrorPage.cshtml"
foreach (var kv in Model.Query.OrderBy(kv => kv.Key))
{
foreach (var v in kv.Value)
@@ -671,19 +692,19 @@ using Views
WriteLiteral(" \r\n " +
" | ");
-#line 176 "ErrorPage.cshtml"
+#line 180 "ErrorPage.cshtml"
Write(kv.Key);
#line default
#line hidden
WriteLiteral(" | \r\n ");
-#line 177 "ErrorPage.cshtml"
+#line 181 "ErrorPage.cshtml"
Write(v);
#line default
#line hidden
WriteLiteral(" | \r\n
\r\n");
-#line 179 "ErrorPage.cshtml"
+#line 183 "ErrorPage.cshtml"
}
}
@@ -691,7 +712,7 @@ using Views
#line hidden
WriteLiteral(" \r\n
\r\n");
-#line 183 "ErrorPage.cshtml"
+#line 187 "ErrorPage.cshtml"
}
else
{
@@ -700,27 +721,27 @@ using Views
#line hidden
WriteLiteral("
");
-#line 186 "ErrorPage.cshtml"
+#line 190 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_NoQueryStringData);
#line default
#line hidden
WriteLiteral("
\r\n");
-#line 187 "ErrorPage.cshtml"
+#line 191 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral("
\r\n");
-#line 189 "ErrorPage.cshtml"
+#line 193 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
-#line 190 "ErrorPage.cshtml"
+#line 194 "ErrorPage.cshtml"
if (Model.Options.ShowCookies)
{
/* TODO:
@@ -757,7 +778,7 @@ using Views
#line hidden
WriteLiteral(" ");
-#line 221 "ErrorPage.cshtml"
+#line 225 "ErrorPage.cshtml"
if (Model.Options.ShowHeaders)
{
@@ -765,13 +786,13 @@ using Views
#line hidden
WriteLiteral(" \r\n");
-#line 252 "ErrorPage.cshtml"
+#line 256 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
-#line 253 "ErrorPage.cshtml"
+#line 257 "ErrorPage.cshtml"
if (Model.Options.ShowEnvironment)
{
/* TODO:
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml
index de7abfad3c..7a0075ac42 100644
--- a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml
+++ b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml
@@ -120,7 +120,7 @@
@if (frame.PreContextCode != null)
@@ -134,7 +134,11 @@
}
- - @frame.ContextCode
+ @foreach (var line in frame.ContextCode)
+ {
+
@line
+ }
+
@if (frame.PostContextCode != null)
{
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/StackFrame.cs b/src/Microsoft.AspNet.Diagnostics/Views/StackFrame.cs
index 2b17068868..4a1ec2f513 100644
--- a/src/Microsoft.AspNet.Diagnostics/Views/StackFrame.cs
+++ b/src/Microsoft.AspNet.Diagnostics/Views/StackFrame.cs
@@ -39,11 +39,16 @@ namespace Microsoft.AspNet.Diagnostics.Views
///
///
///
- public string ContextCode { get; set; }
+ public IEnumerable
ContextCode { get; set; }
///
///
///
public IEnumerable PostContextCode { get; set; }
+
+ ///
+ /// Specific error details for this stack frame.
+ ///
+ public string ErrorDetails { get; set; }
}
}