fix: add warning details when backup is stopped by user

This commit is contained in:
Nicolas Meienberger 2026-03-21 20:32:27 +01:00
parent 026098a3a9
commit 49a030aa41
3 changed files with 3 additions and 3 deletions

View file

@ -235,7 +235,7 @@ describe("stop backup", () => {
// assert // assert
const updatedSchedule = await backupsService.getScheduleById(schedule.id); const updatedSchedule = await backupsService.getScheduleById(schedule.id);
expect(updatedSchedule.lastBackupStatus).toBe("warning"); expect(updatedSchedule.lastBackupStatus).toBe("warning");
expect(updatedSchedule.lastBackupError).toBe("Backup was stopped by user"); expect(updatedSchedule.lastBackupError).toBe("Backup was stopped by the user");
}); });
test("should throw ConflictError when trying to stop non-running backup", async () => { test("should throw ConflictError when trying to stop non-running backup", async () => {

View file

@ -324,7 +324,7 @@ const stopBackup = async (scheduleId: number) => {
} finally { } finally {
await scheduleQueries.updateStatus(scheduleId, organizationId, { await scheduleQueries.updateStatus(scheduleId, organizationId, {
lastBackupStatus: "warning", lastBackupStatus: "warning",
lastBackupError: "Backup was stopped by user", lastBackupError: "Backup was stopped by the user",
}); });
} }
}; };

View file

@ -170,7 +170,7 @@ export const backup = async (
if (options.signal?.aborted) { if (options.signal?.aborted) {
logger.warn("Restic backup was aborted by signal."); logger.warn("Restic backup was aborted by signal.");
return { result: null, exitCode: res.exitCode, warningDetails: null }; return { result: null, exitCode: res.exitCode, warningDetails: "Backup was stopped by the user" };
} }
if (res.exitCode === 3) { if (res.exitCode === 3) {