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

Function catchErrors

code/dependency-injection/public/app.js:7206–7217  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

7204var hasLoggedError = false;
7205
7206function catchErrors(fn) {
7207 return function (arg) {
7208 try {
7209 return fn(arg);
7210 } catch (err) {
7211 if (true && !hasLoggedError) {
7212 hasLoggedError = true;
7213 warning(false, 'React DevTools encountered an error: %s', err);
7214 }
7215 }
7216 };
7217}
7218
7219function injectInternals(internals) {
7220 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {

Callers 1

injectInternalsFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected