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
const updatedSchedule = await backupsService.getScheduleById(schedule.id);
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 () => {

View File

@@ -324,7 +324,7 @@ const stopBackup = async (scheduleId: number) => {
} finally {
await scheduleQueries.updateStatus(scheduleId, organizationId, {
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) {
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) {