diff --git a/packages/cli-repl/src/mongosh-repl.spec.ts b/packages/cli-repl/src/mongosh-repl.spec.ts index 3be21871f..f5cac3853 100644 --- a/packages/cli-repl/src/mongosh-repl.spec.ts +++ b/packages/cli-repl/src/mongosh-repl.spec.ts @@ -121,7 +121,7 @@ describe('MongoshNodeRepl', function () { it('throws an error if internal methods are used too early', function () { expect(() => mongoshRepl.runtimeState()).to.throw( - 'Mongosh not initialized yet' + /mongosh not initialized yet\nCurrent trace/ ); }); diff --git a/packages/cli-repl/src/mongosh-repl.ts b/packages/cli-repl/src/mongosh-repl.ts index 27813995d..a977572c2 100644 --- a/packages/cli-repl/src/mongosh-repl.ts +++ b/packages/cli-repl/src/mongosh-repl.ts @@ -1032,7 +1032,7 @@ class MongoshNodeRepl implements EvaluationListener { // This error can be really hard to debug, so we always attach stack traces // from both when .close() was called and when throw new MongoshInternalError( - `mongosh not initialized yet\nCurrentTrace: ${ + `mongosh not initialized yet\nCurrent trace: ${ new Error().stack }\nClose trace: ${this.closeTrace}\n` );