Skip to content

Fix exception handling during render in .NET Core - #793

Merged
dustinsoftware merged 1 commit into
reactjs:masterfrom
dustinsoftware:fix-async-crash
May 2, 2019
Merged

dustinsoftware merged 1 commit into
reactjs:masterfrom
dustinsoftware:fix-async-crash

Conversation

@dustinsoftware

Copy link
Copy Markdown
Contributor

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

Reonekot commented May 2, 2019

Copy link
Copy Markdown

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

dustinsoftware commented May 2, 2019 via email

Copy link
Copy Markdown
Contributor Author

@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