mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
errors: Rename PlinthError to FbxError
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
d144dce428
commit
7a88c46bb2
@ -4,22 +4,22 @@ Project specific errors
|
||||
"""
|
||||
|
||||
|
||||
class PlinthError(Exception):
|
||||
class FbxError(Exception):
|
||||
"""Base class for all FreedomBox specific errors."""
|
||||
|
||||
|
||||
class PackageNotInstalledError(PlinthError):
|
||||
class PackageNotInstalledError(FbxError):
|
||||
"""Could not complete module setup due to missing package."""
|
||||
|
||||
|
||||
class DomainNotRegisteredError(PlinthError):
|
||||
class DomainNotRegisteredError(FbxError):
|
||||
"""
|
||||
An action couldn't be performed because this
|
||||
FreedomBox doesn't have a registered domain
|
||||
"""
|
||||
|
||||
|
||||
class MissingPackageError(PlinthError):
|
||||
class MissingPackageError(FbxError):
|
||||
"""Package is not available to be installed at this time."""
|
||||
|
||||
def __init__(self, name):
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
|
||||
import subprocess
|
||||
|
||||
from freedombox.errors import PlinthError
|
||||
from freedombox.errors import FbxError
|
||||
|
||||
|
||||
class BorgError(PlinthError):
|
||||
class BorgError(FbxError):
|
||||
"""Generic borg errors."""
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ class SshError(subprocess.CalledProcessError):
|
||||
"""Error when running an SSH command."""
|
||||
|
||||
|
||||
class SshfsError(PlinthError):
|
||||
class SshfsError(FbxError):
|
||||
"""Generic sshfs errors."""
|
||||
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ from django.utils.translation import gettext_lazy
|
||||
from django.views.decorators.http import require_POST
|
||||
from django.views.generic import FormView, TemplateView, View
|
||||
|
||||
from freedombox.errors import PlinthError
|
||||
from freedombox.errors import FbxError
|
||||
from freedombox.modules import backups, storage
|
||||
from freedombox.views import AppView
|
||||
|
||||
@ -201,7 +201,7 @@ class UploadArchiveView(FormView):
|
||||
context['title'] = _('Upload and restore a backup')
|
||||
try:
|
||||
mount_info = storage.get_mount_info('/')
|
||||
except PlinthError as exception:
|
||||
except FbxError as exception:
|
||||
logger.exception(
|
||||
'Error getting information about root partition: %s',
|
||||
exception)
|
||||
|
||||
@ -16,7 +16,7 @@ from django.views.generic.edit import FormView
|
||||
|
||||
from freedombox import app as app_module
|
||||
from freedombox import views
|
||||
from freedombox.errors import PlinthError
|
||||
from freedombox.errors import FbxError
|
||||
from freedombox.modules import storage
|
||||
from freedombox.modules.kiwix import privileged
|
||||
from freedombox.views import messages_error
|
||||
@ -56,7 +56,7 @@ class AddPackageView(SuccessMessageMixin, FormView):
|
||||
# TODO The following is almost duplicated in backups/views.py
|
||||
try:
|
||||
mount_info = storage.get_mount_info('/')
|
||||
except PlinthError as exception:
|
||||
except FbxError as exception:
|
||||
logger.exception(
|
||||
'Error getting information about root partition: %s',
|
||||
exception)
|
||||
|
||||
@ -12,7 +12,7 @@ from django.utils.translation import gettext_noop
|
||||
from freedombox import app as app_module
|
||||
from freedombox import cfg, glib, menu
|
||||
from freedombox.diagnostic_check import DiagnosticCheck, Result
|
||||
from freedombox.errors import PlinthError
|
||||
from freedombox.errors import FbxError
|
||||
from freedombox.modules.backups.components import BackupRestore
|
||||
from freedombox.package import Packages
|
||||
from freedombox.utils import format_lazy
|
||||
@ -186,7 +186,7 @@ def get_mount_info(mount_point):
|
||||
mount for mount in mounts if mount_point == mount['mount_point']
|
||||
]
|
||||
if not list_root:
|
||||
raise PlinthError('Mount point {} not found.'.format(mount_point))
|
||||
raise FbxError('Mount point {} not found.'.format(mount_point))
|
||||
|
||||
percent_used = list_root[0]['percent_used']
|
||||
free_bytes = list_root[0]['free']
|
||||
@ -292,7 +292,7 @@ def warn_about_low_disk_space(_data):
|
||||
|
||||
try:
|
||||
root_info = get_mount_info('/')
|
||||
except PlinthError:
|
||||
except FbxError:
|
||||
return
|
||||
|
||||
show = False
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user