From 18e609313b3ec1c336c5cc6ebb91e2a6a8434481 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Tue, 2 Dec 2025 00:56:27 -0600 Subject: [PATCH] refactor: simplify rollback error handling in rollback function - Removed try-catch block in the rollback function to streamline error handling, allowing for direct propagation of errors from the rollbackApplication call. - This change enhances code readability and maintains the functionality of the rollback process. --- packages/server/src/services/rollbacks.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/packages/server/src/services/rollbacks.ts b/packages/server/src/services/rollbacks.ts index 5677d44b6..2e9da4ee1 100644 --- a/packages/server/src/services/rollbacks.ts +++ b/packages/server/src/services/rollbacks.ts @@ -162,18 +162,13 @@ export const rollback = async (rollbackId: string) => { if (!result.fullContext) { throw new Error("Rollback context not found"); } - try { - // Use the full context for rollback - await rollbackApplication( - application.appName, - result.image || "", - application.serverId, - result.fullContext, - ); - } catch (error) { - console.error(error); - throw new Error("Failed to rollback application"); - } + // Use the full context for rollback + await rollbackApplication( + application.appName, + result.image || "", + application.serverId, + result.fullContext, + ); }; const rollbackApplication = async (