From 7a88c46bb26ad62b85ee16610f32795fcf99e3f2 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 17 Aug 2026 20:36:33 -0700 Subject: [PATCH] errors: Rename PlinthError to FbxError Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- freedombox/errors.py | 8 ++++---- freedombox/modules/backups/errors.py | 6 +++--- freedombox/modules/backups/views.py | 4 ++-- freedombox/modules/kiwix/views.py | 4 ++-- freedombox/modules/storage/__init__.py | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/freedombox/errors.py b/freedombox/errors.py index 4c6bcaeba..e235734c6 100644 --- a/freedombox/errors.py +++ b/freedombox/errors.py @@ -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): diff --git a/freedombox/modules/backups/errors.py b/freedombox/modules/backups/errors.py index a1a2d6a48..abf405040 100644 --- a/freedombox/modules/backups/errors.py +++ b/freedombox/modules/backups/errors.py @@ -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.""" diff --git a/freedombox/modules/backups/views.py b/freedombox/modules/backups/views.py index cf7c92b72..6fb457bef 100644 --- a/freedombox/modules/backups/views.py +++ b/freedombox/modules/backups/views.py @@ -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) diff --git a/freedombox/modules/kiwix/views.py b/freedombox/modules/kiwix/views.py index fbd56ca6d..65a3820ed 100644 --- a/freedombox/modules/kiwix/views.py +++ b/freedombox/modules/kiwix/views.py @@ -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) diff --git a/freedombox/modules/storage/__init__.py b/freedombox/modules/storage/__init__.py index 6cdd90b08..164257041 100644 --- a/freedombox/modules/storage/__init__.py +++ b/freedombox/modules/storage/__init__.py @@ -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