You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* global reportError */exportconstlogRecoverableError=typeofreportError==='function'
? // In modern browsers, reportError will dispatch an error event,// emulating an uncaught JavaScript error.reportError
: (error: mixed)=>{// In older browsers and test environments, fallback to console.error.// eslint-disable-next-line react-internal/no-production-logging, react-internal/warning-argsconsole.error(error);};
We should probably do the same and use reportError for any recoverable error that we usually console.error.
There are many places where we deal with recoverable errors, particularly around localstorage usage.
We could eventually expose a core error reporting API that triggers lifecycle a new client module lifecycle event, this could allow users to build error reporting plugins like Sentry?
Self-service
I'd be willing to do some initial work on this proposal myself.
The text was updated successfully, but these errors were encountered:
Have you read the Contributing Guidelines on issues?
Motivation
Using the new
reportError
api permits to triggerwindow.onerror
and let users (or error reporting services) to plug their own error handling behaviorhttps://www.stefanjudis.com/blog/reporterror-a-method-to-report-to-global-event-handlers/
This is not 100% supported though
https://caniuse.com/?search=reportError
React recently merged a PR using this feature
facebook/react#23207
We should probably do the same and use
reportError
for any recoverable error that we usuallyconsole.error
.There are many places where we deal with recoverable errors, particularly around localstorage usage.
We could eventually expose a core error reporting API that triggers lifecycle a new client module lifecycle event, this could allow users to build error reporting plugins like Sentry?
Self-service
The text was updated successfully, but these errors were encountered: