From 6b6f39aaf4af705c08e3b2ffc0f86426708ec463 Mon Sep 17 00:00:00 2001 From: lizhen Date: Tue, 2 Apr 2024 11:38:43 +0800 Subject: [PATCH] feat: show error log when error throw in ResponseJson --- lib/decorator/index.ts | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/decorator/index.ts b/lib/decorator/index.ts index 9caab93..d0cf06e 100644 --- a/lib/decorator/index.ts +++ b/lib/decorator/index.ts @@ -403,6 +403,7 @@ export const ResponseJson = rs = await oriValue.apply(this, args); rs = dataWrapper(rs); } catch (e) { + ctx.logger.error(e); rs = errorWrapper(e); } ctx.body = rs; diff --git a/package.json b/package.json index 9ea6c37..6176418 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "egg-fancy-decorator", - "version": "1.0.5", + "version": "1.0.6", "description": "Decorator support plugin for egg framework", "main": "lib/index.js", "types": "index.d.ts",