Skip to content

Commit 68377ff

Browse files
committed
fix: save execution stack in query as string
Backport #15039 to 6.x
1 parent 6fbe9f0 commit 68377ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/helpers/query/wrapThunk.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ module.exports = function wrapThunk(fn) {
2121
str = str.slice(0, 60) + '...';
2222
}
2323
const err = new MongooseError('Query was already executed: ' + str);
24-
err.originalStack = this._executionStack.stack;
24+
err.originalStack = this._executionStack;
2525
return cb(err);
2626
}
27-
this._executionStack = new Error();
27+
this._executionStack = new Error().stack;
2828

2929
fn.call(this, cb);
3030
};

0 commit comments

Comments
 (0)