Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Added path info to RazorPage exceptions #2391

Merged
merged 1 commit into from
Apr 17, 2015
Merged

Added path info to RazorPage exceptions #2391

merged 1 commit into from
Apr 17, 2015

Conversation

ajaybhargavb
Copy link
Contributor

Issue - #1919
The exception referenced by the issue has already been fixed.
I've updated few other exceptions in RazorPage and RazorView.
@Eilon @pranavkm

@ghost ghost added the cla-already-signed label Apr 15, 2015
@@ -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");
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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.

@dougbu
Copy link
Member

dougbu commented Apr 16, 2015

@pranavkm
Copy link
Contributor

@ajaybhargavb
Copy link
Contributor Author

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));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: long

@dougbu
Copy link
Member

dougbu commented Apr 16, 2015

:shipit:

@Eilon
Copy link
Member

Eilon commented Apr 16, 2015

:shipit: from me too

@pranavkm
Copy link
Contributor

:shipit:

@ajaybhargavb ajaybhargavb merged commit f878ca5 into dev Apr 17, 2015
@ajaybhargavb ajaybhargavb deleted the render-body-fix branch April 23, 2015 22:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants