MCPcopy Create free account
hub / github.com/apache/skywalking-nodejs / wrapCallback

Function wrapCallback

src/core/SwPlugin.ts:61–69  ·  view source on GitHub ↗
(span: Span, callback: any, idxError: any = false)

Source from the content-addressed store, hash-verified

59};
60
61export const wrapCallback = (span: Span, callback: any, idxError: any = false) => {
62 return function (this: any) {
63 if (idxError !== false && arguments[idxError]) span.error(arguments[idxError]);
64
65 span.stop();
66
67 return callback.apply(this, arguments);
68 };
69};
70
71export const wrapPromise = (span: Span, promise: any) => {
72 return promise.then(

Callers 4

installMethod · 0.90
interceptOperationMethod · 0.90
installMethod · 0.90
installMethod · 0.90

Calls 2

errorMethod · 0.80
stopMethod · 0.65

Tested by

no test coverage detected