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

Function catchErrors

code/styling/public/app.js:7113–7124  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

7111var hasLoggedError = false;
7112
7113function catchErrors(fn) {
7114 return function (arg) {
7115 try {
7116 return fn(arg);
7117 } catch (err) {
7118 if (true && !hasLoggedError) {
7119 hasLoggedError = true;
7120 warning(false, 'React DevTools encountered an error: %s', err);
7121 }
7122 }
7123 };
7124}
7125
7126function injectInternals(internals) {
7127 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {

Callers 1

injectInternalsFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected