We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef52f24 commit fa25d57Copy full SHA for fa25d57
1 file changed
src/lifecycle.ts
@@ -1,6 +1,6 @@
1
import assert from 'node:assert';
2
import { EventEmitter } from 'node:events';
3
-import { debuglog } from 'node:util';
+import { debuglog, format } from 'node:util';
4
import { isClass } from 'is-type-of';
5
import { Ready as ReadyObject } from 'get-ready';
6
import type { ReadyFunctionArg } from 'get-ready';
@@ -387,6 +387,10 @@ export class Lifecycle extends EventEmitter {
387
done();
388
this.timing.end(timingKey);
389
}, (err: Error) => {
390
+ // avoid non-stringify error: TypeError: Cannot convert object to primitive value
391
+ if (!(err instanceof Error)) {
392
+ err = new Error(format('%s', err));
393
+ }
394
done(err);
395
396
});
0 commit comments