-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Added path info to RazorPage exceptions #2391
Conversation
@@ -179,7 +179,7 @@ private bool EnableInstrumentation | |||
// the body content. Throwing this exception wouldn't return a 500 (since content has already been | |||
// written), but a diagnostic component should be able to capture it. | |||
|
|||
var message = Resources.FormatLayoutCannotBeRendered("FlushAsync"); | |||
var message = Resources.FormatLayoutCannotBeRendered(Path, "FlushAsync"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nameof(RazorPage.FlushAsync)
while you're here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlushAsync
is not part of IRazorPage
. So can't access it from here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the issue is the RazorPage
property hiding the class. but nameof(Razor.RazorPage.FlushAsync)
works.
⌚ |
Couple more places where we could print out the path:
|
Updated. |
@@ -748,14 +748,14 @@ public Task<HtmlString> RenderSectionAsync([NotNull] string name) | |||
// change. | |||
if (_writerScopes.Count > 0) | |||
{ | |||
throw new InvalidOperationException(Resources.RazorPage_YouCannotFlushWhileInAWritingScope); | |||
throw new InvalidOperationException(Resources.FormatRazorPage_CannotFlushWhileInAWritingScope(nameof(FlushAsync), Path)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: long
from me too |
509fd77
to
28d5df3
Compare
28d5df3
to
f878ca5
Compare
Issue - #1919
The exception referenced by the issue has already been fixed.
I've updated few other exceptions in
RazorPage
andRazorView
.@Eilon @pranavkm