Skip to content

Commit eef782f

Browse files
committed
fix: use .then() instead of .catch() for shadow mode error logging
1 parent 4cbbadb commit eef782f

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

apps/webapp/app/v3/services/computeTemplateCreation.server.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,23 @@ export class ComputeTemplateCreationService {
4646
}
4747

4848
if (mode === "shadow") {
49-
this.createTemplate(options.imageReference, { background: true }).catch((error) => {
50-
logger.error("Shadow compute template creation failed", {
51-
id: options.deploymentFriendlyId,
52-
imageReference: options.imageReference,
53-
error: error instanceof Error ? error.message : String(error),
49+
this.createTemplate(options.imageReference, { background: true })
50+
.then((result) => {
51+
if (!result.success) {
52+
logger.error("Shadow template creation failed", {
53+
id: options.deploymentFriendlyId,
54+
imageReference: options.imageReference,
55+
error: result.error,
56+
});
57+
}
58+
})
59+
.catch((error) => {
60+
logger.error("Shadow template creation threw unexpectedly", {
61+
id: options.deploymentFriendlyId,
62+
imageReference: options.imageReference,
63+
error: error instanceof Error ? error.message : String(error),
64+
});
5465
});
55-
});
5666
return;
5767
}
5868

0 commit comments

Comments
 (0)