-
Notifications
You must be signed in to change notification settings - Fork 46.7k
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
Cross-origin error handling in DEV #10353
Merged
Merged
Commits on Aug 1, 2017
-
Configuration menu - View commit details
-
Copy full SHA for 01e2470 - Browse repository at this point
Copy the full SHA 01e2470View commit details
Commits on Aug 2, 2017
-
Use a custom error object in place of cross-origin errors
Cross-origin errors aren't accessible by React in DEV mode because we catch errors using a global error handler, in order to preserve the "Pause on exceptions" behavior of the DevTools. When this happens, we should use a custom error object that explains what happened. For uncaught errors, the actual error message is logged to the console by the browser, so React should skip logging the message again.
Configuration menu - View commit details
-
Copy full SHA for cb6fd8c - Browse repository at this point
Copy the full SHA cb6fd8cView commit details
Commits on Aug 3, 2017
-
Configuration menu - View commit details
-
Copy full SHA for 6f6425b - Browse repository at this point
Copy the full SHA 6f6425bView commit details -
Don't double log error messages in DEV
In DEV, the browser always logs errors thrown inside React components, even if the originating update is wrapped in a try-catch, because of the dispatchEvent trick used by invokeGuardedCallback. So the error logger should not log the message again.
Configuration menu - View commit details
-
Copy full SHA for b145a08 - Browse repository at this point
Copy the full SHA b145a08View commit details -
Configuration menu - View commit details
-
Copy full SHA for af46b61 - Browse repository at this point
Copy the full SHA af46b61View commit details -
Configuration menu - View commit details
-
Copy full SHA for 26770b2 - Browse repository at this point
Copy the full SHA 26770b2View commit details -
Change how error is printed in DEV and PROD
In DEV, we don't want to print the stack trace because the browser already always prints it. We'll just print the component stack now. In PROD, we used to omit the JS error message. However we *do* want to show it because if the application swallows the error, the browser will *not* print it. In DEV it works only because of the fake event trick. So in PROD we will always print the underlying error by logging the error object directly. This will show both the message and the JS stack.
Configuration menu - View commit details
-
Copy full SHA for fde39dc - Browse repository at this point
Copy the full SHA fde39dcView commit details -
Make the wording tighter and emphasize the real error is above
There's a few goals in the rewording: * Make it tighter using line breaks between sentences. * Make it slightly less patronizing ("You should fix it" => "You can find its details in an earlier log") * ^^ This also helps highlight that the real error message and stack is above * Group subsections: intro (there's an error), component stack, and final addendum about error boundaries * ^^ Otherwise people might think error boundaries are part of the reason they have an error * Make it clear "located at" is not the stacktrace. Otherwise it feels confusing. This makes it clearer you should still look for stack trace (with other details) above and introduces the concept of component stack.
Configuration menu - View commit details
-
Copy full SHA for fa20c9c - Browse repository at this point
Copy the full SHA fa20c9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 095e29b - Browse repository at this point
Copy the full SHA 095e29bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b183b5 - Browse repository at this point
Copy the full SHA 8b183b5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39dea7e - Browse repository at this point
Copy the full SHA 39dea7eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3364def - Browse repository at this point
Copy the full SHA 3364defView commit details -
Configuration menu - View commit details
-
Copy full SHA for d99b90d - Browse repository at this point
Copy the full SHA d99b90dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 311a3f8 - Browse repository at this point
Copy the full SHA 311a3f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a8b033 - Browse repository at this point
Copy the full SHA 9a8b033View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39df724 - Browse repository at this point
Copy the full SHA 39df724View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2ea6063 - Browse repository at this point
Copy the full SHA 2ea6063View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.