Handle non-existing backup file (#5590)

* Make the API return 404 for non-existing backup files

* Introduce BackupFileNotFoundError exception

* Return 404 on full restore as well

* Fix remaining API tests

* Improve error handling in delete

* Fix pytest

* Fix tests and change error handling to agreed logic

---------

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
This commit is contained in:
Stefan Agner
2025-01-31 14:27:24 +01:00
committed by GitHub
parent 1aabca9489
commit 30cbb039d0
9 changed files with 114 additions and 24 deletions

View File

@@ -659,6 +659,10 @@ class BackupJobError(BackupError, JobException):
"""Raise on Backup job error."""
class BackupFileNotFoundError(BackupError):
"""Raise if the backup file hasn't been found."""
# Security