MCPcopy Index your code
hub / github.com/apache/skywalking-nodejs / wrapPromise

Function wrapPromise

src/core/SwPlugin.ts:71–86  ·  view source on GitHub ↗
(span: Span, promise: any)

Source from the content-addressed store, hash-verified

69};
70
71export const wrapPromise = (span: Span, promise: any) => {
72 return promise.then(
73 (res: any) => {
74 span.stop();
75
76 return res;
77 },
78
79 (err: any) => {
80 span.error(err);
81 span.stop();
82
83 return Promise.reject(err);
84 },
85 );
86};

Callers 4

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

Calls 2

errorMethod · 0.80
stopMethod · 0.65

Tested by

no test coverage detected