package: Drop special error message handling for package errors

- We have new way to show extra details with exceptions in HTML.

- This handling of error details in PackageException is mostly unused and
unnecessary complexity.

Tests:

- Introduce exception into package.install() and package.uninstall() methods.
Test that exceptions are being shown properly in Django error messages.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2024-03-19 11:46:26 -04:00
1 parent 28e417d7ef
commit ade2d0c8f2
2 files changed
+1 -33

No files matched your search

-12
View File
@@ -275,18 +275,6 @@ class Packages(app_module.FollowerComponent):
class PackageException(Exception):
"""A package operation has failed."""
def __init__(self, error_string=None, error_details=None, *args, **kwargs):
"""Store apt-get error string and details."""
super().__init__(*args, **kwargs)
self.error_string = error_string
self.error_details = error_details
def __str__(self):
"""Return the strin representation of the exception."""
return 'PackageException(error_string="{0}", error_details="{1}")' \
.format(self.error_string, self.error_details)
class Transaction:
"""Information about an ongoing transaction."""