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

Function catchErrors

code/communication/public/app.js:7148–7159  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

7146var hasLoggedError = false;
7147
7148function catchErrors(fn) {
7149 return function (arg) {
7150 try {
7151 return fn(arg);
7152 } catch (err) {
7153 if (true && !hasLoggedError) {
7154 hasLoggedError = true;
7155 warning(false, 'React DevTools encountered an error: %s', err);
7156 }
7157 }
7158 };
7159}
7160
7161function injectInternals(internals) {
7162 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {

Callers 1

injectInternalsFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected