MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / catchErrors

Function catchErrors

code/third-party/public/app.js:6346–6357  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

6344var hasLoggedError = false;
6345
6346function catchErrors(fn) {
6347 return function (arg) {
6348 try {
6349 return fn(arg);
6350 } catch (err) {
6351 if (true && !hasLoggedError) {
6352 hasLoggedError = true;
6353 warning(false, 'React DevTools encountered an error: %s', err);
6354 }
6355 }
6356 };
6357}
6358
6359function injectInternals(internals) {
6360 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {

Callers 1

injectInternalsFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected