1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-27 10:18:12 +00:00

add NotFoundWarning

This commit is contained in:
Thomas Waldmann 2023-11-18 22:49:56 +01:00
parent 4adc782100
commit 9ac4672254
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01
2 changed files with 10 additions and 0 deletions

View file

@ -721,6 +721,8 @@ Warnings
{}: {}
IOWarning rc: 106
{}: {}
NotFoundWarning rc: 107
{}: {}
Operations
- cache.begin_transaction

View file

@ -128,6 +128,8 @@ def exit_code(self):
assert isinstance(exc, BackupOSError)
if exc.errno in (errno.EPERM, errno.EACCES):
return PermissionWarning.exit_mcode
elif exc.errno in (errno.ENOENT,):
return NotFoundWarning.exit_mcode
elif exc.errno in (errno.EIO,):
return IOWarning.exit_mcode
else:
@ -146,6 +148,12 @@ class IOWarning(BorgWarning):
exit_mcode = 106
class NotFoundWarning(BorgWarning):
"""{}: {}"""
exit_mcode = 107
class BackupError(Exception):
"""
Exception raised for non-OSError-based exceptions while accessing backup files.