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

Function catchErrors

code/composition/public/app.js:7251–7262  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

7249var hasLoggedError = false;
7250
7251function catchErrors(fn) {
7252 return function (arg) {
7253 try {
7254 return fn(arg);
7255 } catch (err) {
7256 if (true && !hasLoggedError) {
7257 hasLoggedError = true;
7258 warning(false, 'React DevTools encountered an error: %s', err);
7259 }
7260 }
7261 };
7262}
7263
7264function injectInternals(internals) {
7265 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {

Callers 1

injectInternalsFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected