Skip to content

Fix exception handling during render in .NET Core #793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2019

Conversation

dustinsoftware
Copy link
Member

If an exception is thrown outside of the render call in
Razor views (async invocation), the app could crash. This does not appear
to be an issue in ASP.NET.

Unfortunately this means extra string allocations to hold the render
result, but the rest of the StringBuilder logic used internally is not
a problem.

Will merge sometime tomorrow if build passes.

If an exception is thrown outside of the render call in
Razor views (async invocation), the app could crash. This does not appear
to be an issue in ASP.NET.

Unfortunately this means extra string allocations to hold the render
result, but the rest of the StringBuilder logic used internally is not
a problem.
@Reonekot
Copy link

Reonekot commented May 2, 2019

Out of curiosity, wouldn't it better (faster, avoiding handling the StringWriter, avoiding the allocation at the end) to write to ViewContext.Writer ? Ie. a RenderReact method, which doesn't allocate/return a new string?

@dustinsoftware
Copy link
Member Author

dustinsoftware commented May 2, 2019 via email

@dustinsoftware dustinsoftware merged commit 9d14b8e into reactjs:master May 2, 2019
@dustinsoftware dustinsoftware added this to the 4.1.2 milestone May 2, 2019
peterennis added a commit to peterennis/aereact that referenced this pull request May 3, 2019
Fix exception handling during render in .NET Core (reactjs#793)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants