Skip to content
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

Better messaging for componentDidCatch cross-origin errors #10447

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/renderers/shared/utils/ReactErrorUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,8 @@ if (__DEV__) {
} else if (isCrossOriginError) {
error = new Error(
"A cross-origin error was thrown. React doesn't have access to " +
'the actual error because it catches errors using a global ' +
'error handler, in order to preserve the "Pause on exceptions" ' +
'behavior of the DevTools. This is only an issue in DEV-mode; ' +
'in production, React uses a normal try-catch statement.\n\n' +
'If you are using React from a CDN, ensure that the <script> tag ' +
'has a `crossorigin` attribute, and that it is served with the ' +
'`Access-Control-Allow-Origin: *` HTTP header. ' +
'See https://fb.me/react-cdn-crossorigin',
'the actual error object in development. ' +
'See https://fb.me/react-crossorigin-error for more information.',
);
}
ReactErrorUtils._hasCaughtError = true;
Expand Down