Skip to content

Commit 4be25da

Browse files
committed
fix: add error handling for volume backup notification sending
1 parent 675c1d7 commit 4be25da

1 file changed

Lines changed: 25 additions & 17 deletions

File tree

  • packages/server/src/utils/volume-backups

packages/server/src/utils/volume-backups/utils.ts

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,18 @@ export const runVolumeBackup = async (volumeBackupId: string) => {
131131
? "mongodb"
132132
: volumeBackup.serviceType;
133133

134-
await sendVolumeBackupNotifications({
135-
projectName,
136-
applicationName: volumeBackup.name,
137-
volumeName: volumeBackup.volumeName,
138-
serviceType: mappedServiceType,
139-
type: "success",
140-
organizationId,
141-
});
134+
try {
135+
await sendVolumeBackupNotifications({
136+
projectName,
137+
applicationName: volumeBackup.name,
138+
volumeName: volumeBackup.volumeName,
139+
serviceType: mappedServiceType,
140+
type: "success",
141+
organizationId,
142+
});
143+
} catch (notificationError) {
144+
console.error("Failed to send volume backup success notification", notificationError);
145+
}
142146
} catch (error) {
143147
const { VOLUME_BACKUPS_PATH } = paths(!!serverId);
144148
const volumeBackupPath = path.join(
@@ -160,14 +164,18 @@ export const runVolumeBackup = async (volumeBackupId: string) => {
160164
? "mongodb"
161165
: volumeBackup.serviceType;
162166

163-
await sendVolumeBackupNotifications({
164-
projectName,
165-
applicationName: volumeBackup.name,
166-
volumeName: volumeBackup.volumeName,
167-
serviceType: mappedServiceType,
168-
type: "error",
169-
organizationId,
170-
errorMessage: error instanceof Error ? error.message : String(error),
171-
});
167+
try {
168+
await sendVolumeBackupNotifications({
169+
projectName,
170+
applicationName: volumeBackup.name,
171+
volumeName: volumeBackup.volumeName,
172+
serviceType: mappedServiceType,
173+
type: "error",
174+
organizationId,
175+
errorMessage: error instanceof Error ? error.message : String(error),
176+
});
177+
} catch (notificationError) {
178+
console.error("Failed to send volume backup error notification", notificationError);
179+
}
172180
}
173181
};

0 commit comments

Comments
 (0)