From b51060089d75fdbce3686babdf255527f2a25b0b Mon Sep 17 00:00:00 2001 From: Shigma <1700011071@pku.edu.cn> Date: Sun, 2 Feb 2020 01:13:55 +0800 Subject: [PATCH] feat(cli): optimize error --- packages/koishi-cli/src/worker.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/koishi-cli/src/worker.ts b/packages/koishi-cli/src/worker.ts index a0b76b7f68..6347e45b25 100644 --- a/packages/koishi-cli/src/worker.ts +++ b/packages/koishi-cli/src/worker.ts @@ -39,7 +39,11 @@ let config: AppConfig | AppConfig[] function tryCallback (callback: () => T) { try { return callback() - } catch {} + } catch (error) { + if (error.code !== 'MODULE_NOT_FOUND' && error.code !== 'ENOENT') { + throw error + } + } } if (['.js', '.json', '.ts'].includes(extension)) {