From fa25d572b0f96cfa72a4484c17946fe661e1b058 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Tue, 21 Jan 2025 23:25:10 +0800 Subject: [PATCH 1/2] fix: avoid non-stringify error (#289) --- src/lifecycle.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lifecycle.ts b/src/lifecycle.ts index 5da7adaf..9c118b27 100644 --- a/src/lifecycle.ts +++ b/src/lifecycle.ts @@ -1,6 +1,6 @@ import assert from 'node:assert'; import { EventEmitter } from 'node:events'; -import { debuglog } from 'node:util'; +import { debuglog, format } from 'node:util'; import { isClass } from 'is-type-of'; import { Ready as ReadyObject } from 'get-ready'; import type { ReadyFunctionArg } from 'get-ready'; @@ -387,6 +387,10 @@ export class Lifecycle extends EventEmitter { done(); this.timing.end(timingKey); }, (err: Error) => { + // avoid non-stringify error: TypeError: Cannot convert object to primitive value + if (!(err instanceof Error)) { + err = new Error(format('%s', err)); + } done(err); this.timing.end(timingKey); }); From 799d37fc4595729bc32161ebc7a6baa2078741f5 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 21 Jan 2025 15:26:04 +0000 Subject: [PATCH 2/2] Release 6.3.1 [skip ci] ## [6.3.1](https://github.com/eggjs/core/compare/v6.3.0...v6.3.1) (2025-01-21) ### Bug Fixes * avoid non-stringify error ([#289](https://github.com/eggjs/core/issues/289)) ([fa25d57](https://github.com/eggjs/core/commit/fa25d572b0f96cfa72a4484c17946fe661e1b058)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc21fc0a..a5254233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [6.3.1](https://github.com/eggjs/core/compare/v6.3.0...v6.3.1) (2025-01-21) + + +### Bug Fixes + +* avoid non-stringify error ([#289](https://github.com/eggjs/core/issues/289)) ([fa25d57](https://github.com/eggjs/core/commit/fa25d572b0f96cfa72a4484c17946fe661e1b058)) + ## [6.3.0](https://github.com/eggjs/core/compare/v6.2.13...v6.3.0) (2025-01-20) diff --git a/package.json b/package.json index 4998e0b0..cab0d337 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eggjs/core", - "version": "6.3.0", + "version": "6.3.1", "publishConfig": { "access": "public" },