From 0ec1fbd0bf1e020ecd8f53fba38d7e53d2462b27 Mon Sep 17 00:00:00 2001 From: Berton Zhu Date: Fri, 15 Apr 2022 04:39:11 +0800 Subject: [PATCH] feat(cli): output file name when error happen to handling a file (#702) --- packages/cli/src/dirCommand.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/dirCommand.ts b/packages/cli/src/dirCommand.ts index 907220ea..818dbcd8 100644 --- a/packages/cli/src/dirCommand.ts +++ b/packages/cli/src/dirCommand.ts @@ -146,7 +146,10 @@ export const dirCommand: SvgrCommand = async ( } const dest = path.resolve(outDir as string, path.relative(root, filename)) - return write(filename, dest) + return write(filename, dest).catch(err => { + console.error('Failed to handle file: ', filename) + throw err + }) } await Promise.all(