Skip to content

Commit 6a1321b

Browse files
author
gitikavj
committed
fix: handle unhandled promise rejection in vended CDK main()
1 parent 9d7cf9d commit 6a1321b

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
@@ -92,7 +92,10 @@ async function main() {
9292
app.synth();
9393
}
9494
95-
main();
95+
main().catch((error: unknown) => {
96+
console.error('AgentCore CDK synthesis failed:', error instanceof Error ? error.message : error);
97+
process.exitCode = 1;
98+
});
9699
"
97100
`;
98101

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)