Sunil Mohan Adapa 872e161ec2
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>
2025-01-13 19:17:25 -05:00

40 lines
1004 B
Python

# SPDX-License-Identifier: AGPL-3.0-or-later
from plinth.errors import PlinthError
class BorgError(PlinthError):
"""Generic borg errors"""
class BorgRepositoryDoesNotExistError(BorgError):
"""Borg access to a repository works but the repository does not exist"""
class SshfsError(PlinthError):
"""Generic sshfs errors"""
class BorgRepositoryExists(BorgError):
"""A repository at target location already exists during initialization."""
class BorgUnencryptedRepository(BorgError):
"""Attempt to provide password on an unencrypted repository."""
class BorgArchiveExists(BorgError):
"""A archive with the given name already exists in the repository."""
class BorgArchiveDoesNotExist(BorgError):
"""Specified archive does not exist in the repository."""
class BorgBusy(BorgError):
"""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."""