Skip to content

Commit ecaedf8

Browse files
authored
fix: handle unhandled promise rejection in vended CDK main() (#409)
1 parent c7eead8 commit ecaedf8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ async function main() {
8080
app.synth();
8181
}
8282
83-
main();
83+
main().catch((error: unknown) => {
84+
console.error('AgentCore CDK synthesis failed:', error instanceof Error ? error.message : error);
85+
process.exitCode = 1;
86+
});
8487
"
8588
`;
8689

src/assets/cdk/bin/cdk.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@ async function main() {
4747
app.synth();
4848
}
4949

50-
main();
50+
main().catch((error: unknown) => {
51+
console.error('AgentCore CDK synthesis failed:', error instanceof Error ? error.message : error);
52+
process.exitCode = 1;
53+
});

0 commit comments

Comments
 (0)