From 58856fad958871ff372571a1aa7f0b36ee9a197b Mon Sep 17 00:00:00 2001 From: Ben Limmer Date: Thu, 14 Oct 2021 15:12:58 -0600 Subject: [PATCH] chore(lambda-nodejs): improve spawnSync error message --- packages/@aws-cdk/aws-lambda-nodejs/lib/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-lambda-nodejs/lib/util.ts b/packages/@aws-cdk/aws-lambda-nodejs/lib/util.ts index 5ead91793e93b..af24d3b4ae371 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/lib/util.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/lib/util.ts @@ -64,7 +64,7 @@ export function exec(cmd: string, args: string[], options?: SpawnSyncOptions) { if (proc.stdout || proc.stderr) { throw new Error(`[Status ${proc.status}] stdout: ${proc.stdout?.toString().trim()}\n\n\nstderr: ${proc.stderr?.toString().trim()}`); } - throw new Error(`${cmd} exited with status ${proc.status}`); + throw new Error(`${cmd} ${args.join(' ')} ${options?.cwd ? `run in directory ${options.cwd}` : ''} exited with status ${proc.status}`); } return proc;