Skip to content

Commit 93dad98

Browse files
authored
Merge pull request #15039 from durran/error-stack
fix: save execution stack in query as string
2 parents 7aba322 + 85c538d commit 93dad98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/query.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4433,10 +4433,10 @@ Query.prototype.exec = async function exec(op) {
44334433
str = str.slice(0, 60) + '...';
44344434
}
44354435
const err = new MongooseError('Query was already executed: ' + str);
4436-
err.originalStack = this._executionStack.stack;
4436+
err.originalStack = this._executionStack;
44374437
throw err;
44384438
} else {
4439-
this._executionStack = new Error();
4439+
this._executionStack = new Error().stack;
44404440
}
44414441

44424442
let skipWrappedFunction = null;

0 commit comments

Comments
 (0)