Skip to content

Dont try to parseJson unless redbox error starts with {#5439

Merged
3 commits merged intomicrosoft:masterfrom
acoates-ms:lessredboxthrow
Jul 8, 2020
Merged

Dont try to parseJson unless redbox error starts with {#5439
3 commits merged intomicrosoft:masterfrom
acoates-ms:lessredboxthrow

Conversation

@acoates-ms
Copy link
Copy Markdown
Contributor

@acoates-ms acoates-ms commented Jul 7, 2020

Currently when we hit a redbox error that is just a plain string, an exception is thrown as we attempt to parse the string as JSON.

In addition to being an annoying exception that causes the debugger to break when you have break on exceptions on, it also can cause the app to crash depending on the string.

This change avoids the attempted parse unless the string starts with a {, which it will in the case of metro errors which is what the code is trying to determine.

Microsoft Reviewers: Open in CodeFlow

@acoates-ms acoates-ms requested a review from a team as a code owner July 7, 2020 18:52
Comment thread vnext/Microsoft.ReactNative/RedBox.cpp
Comment thread vnext/Microsoft.ReactNative/RedBox.cpp Outdated
@acoates-ms acoates-ms added the AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity) label Jul 7, 2020
@ghost
Copy link
Copy Markdown

ghost commented Jul 7, 2020

Hello @acoates-ms!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 10 hours, a condition that will be fulfilled in about 8 hours 44 minutes. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

Copy link
Copy Markdown
Member

@dannyvv dannyvv left a comment

Choose a reason for hiding this comment

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

:shipit:

@ghost ghost merged commit 16cba2e into microsoft:master Jul 8, 2020
@acoates-ms acoates-ms deleted the lessredboxthrow branch August 5, 2020 17:22
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants