Skip to content

Commit

Permalink
Renaming callback index variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrelucas committed Mar 10, 2024
1 parent fac1251 commit f205174
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/node/instrumentation-mongoose/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ export function handleCallbackResponse(
newArgs.push(argValue);
}

let index = 0;
let callbackArgumentIndex = 0;
if (newArgs.length === 2) {
index = 1;
callbackArgumentIndex = 1;
}

newArgs[index] = (err: Error, response: any): any => {
newArgs[callbackArgumentIndex] = (err: Error, response: any): any => {
err
? setErrorStatus(span, err)
: applyResponseHook(span, response, responseHook, moduleVersion);
Expand Down

0 comments on commit f205174

Please sign in to comment.