MCPcopy
hub / github.com/creationix/js-git / wrap

Function wrap

net/tcp-chrome-sockets.js:99–108  ·  view source on GitHub ↗
(fn, onError)

Source from the content-addressed store, hash-verified

97
98
99function wrap(fn, onError) {
100 return function () {
101 try {
102 return fn.apply(this, arguments);
103 }
104 catch (err) {
105 onError(err);
106 }
107 };
108}

Callers 1

connectFunction · 0.70

Calls 1

onErrorFunction · 0.50

Tested by

no test coverage detected