Skip to content

Commit 8fbd385

Browse files
authored
fix(cli): program execution fails without debug information (#28687)
When executing the CDK app program fails, we don't print any useful debug information. This makes sense because we are passing all output from the program to the shell, expecting this would be enough to debug any faults. However the program might be faulty in a way that no (useful) output is printed. To help with this case print the failing command when `--debug` is enabled. This might require a follow up with a better DX for the generic non debug case. For now this will improve the situation. Related to #28637 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 68d9c8b commit 8fbd385

File tree

1 file changed

+1
-0
lines changed
  • packages/aws-cdk/lib/api/cxapp

1 file changed

+1
-0
lines changed

packages/aws-cdk/lib/api/cxapp/exec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export async function execProgram(aws: SdkProvider, config: Configuration): Prom
118118
if (code === 0) {
119119
return ok();
120120
} else {
121+
debug('failed command:', commandAndArgs);
121122
return fail(new Error(`Subprocess exited with error ${code}`));
122123
}
123124
});

0 commit comments

Comments
 (0)