Handle OS errors on backup create (#5662)

* Handle permission error on backup create

Make sure we handle (write) permission errors when creating a backup.

* Introduce BackupFileExistError and BackupPermissionError exceptions

* Make error messages a bit more uniform

* Drop use of exclusive mode

SecureTar does not handle exclusive mode nicely. Drop use of it for now.
This commit is contained in:
Stefan Agner
2025-02-24 21:34:23 +01:00
committed by GitHub
parent 32936e5de0
commit ce8b107f1e
3 changed files with 64 additions and 4 deletions

View File

@@ -663,6 +663,14 @@ class BackupFileNotFoundError(BackupError):
"""Raise if the backup file hasn't been found."""
class BackupPermissionError(BackupError):
"""Raise if we could not write the backup due to permission error."""
class BackupFileExistError(BackupError):
"""Raise if the backup file already exists."""
# Security