Skip to content

Commit

Permalink
fix(cli): program execution fails without debug information
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mrgrain committed Jan 12, 2024
1 parent cbe2378 commit bb26373
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/aws-cdk/lib/api/cxapp/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export async function execProgram(aws: SdkProvider, config: Configuration): Prom
if (code === 0) {
return ok();
} else {
debug('failed command:', commandAndArgs);
return fail(new Error(`Subprocess exited with error ${code}`));
}
});
Expand Down

0 comments on commit bb26373

Please sign in to comment.