Skip to content

Commit

Permalink
fix: save execution stack in query as string
Browse files Browse the repository at this point in the history
Backport #15039 to 6.x
  • Loading branch information
vkarpov15 committed Nov 15, 2024
1 parent 6fbe9f0 commit 68377ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/helpers/query/wrapThunk.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ module.exports = function wrapThunk(fn) {
str = str.slice(0, 60) + '...';
}
const err = new MongooseError('Query was already executed: ' + str);
err.originalStack = this._executionStack.stack;
err.originalStack = this._executionStack;
return cb(err);
}
this._executionStack = new Error();
this._executionStack = new Error().stack;

fn.call(this, cb);
};
Expand Down

0 comments on commit 68377ff

Please sign in to comment.