mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
backups: Handle error when there is not enough space on disk
Tests: - Fill up disk to have very little space left. Perform a large backup operation by writing a large file to one of the directories to be backed up. Try to perform the backup and notice that a nice error message is shown that there is not enough disk space instead of a generic error message. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
055e7603b2
commit
872e161ec2
@ -33,3 +33,7 @@ class BorgArchiveDoesNotExist(BorgError):
|
|||||||
|
|
||||||
class BorgBusy(BorgError):
|
class BorgBusy(BorgError):
|
||||||
"""Borg could not acquire lock being busy with another operation."""
|
"""Borg could not acquire lock being busy with another operation."""
|
||||||
|
|
||||||
|
|
||||||
|
class BorgNoSpace(BorgError):
|
||||||
|
"""There is not enough space left on the device to perform operation."""
|
||||||
|
|||||||
@ -87,6 +87,11 @@ KNOWN_ERRORS = [
|
|||||||
'message': _('Backup system is busy with another operation.'),
|
'message': _('Backup system is busy with another operation.'),
|
||||||
'raise_as': errors.BorgBusy,
|
'raise_as': errors.BorgBusy,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'errors': ['No space left on device'],
|
||||||
|
'message': _('Not enough space left on the disk or remote location.'),
|
||||||
|
'raise_as': errors.BorgNoSpace,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user