diff --git a/src/stratis_cli/_error_reporting.py b/src/stratis_cli/_error_reporting.py index 292266a37..31501e1e6 100644 --- a/src/stratis_cli/_error_reporting.py +++ b/src/stratis_cli/_error_reporting.py @@ -264,17 +264,6 @@ def _interpret_errors_2(errors: List[BaseException]) -> Optional[str]: # noqa: dbus_message = next_error.get_dbus_message() context = error.context - if dbus_name == "org.freedesktop.zbus.Error" and isinstance( - context, DPClientSetPropertyContext - ): - return ( - f"stratisd failed to perform the operation that you " - f"requested, because it could not set the D-Bus " - f'property "{context.property_name}" belonging to ' - f'interface "{error.interface_name}" to "{context.value}". ' - f"It returned the following error: {dbus_message}." - ) - # We do not test this error, as the only known way to cause it is # manipulation of selinux configuration, which is too laborious to # bother with at this time. @@ -312,6 +301,15 @@ def _interpret_errors_2(errors: List[BaseException]) -> Optional[str]: # noqa: f"service sent the following message: {dbus_message}." ) + if isinstance(context, DPClientSetPropertyContext): # pragma: no cover + return ( + f"stratisd failed to perform the operation that you " + f"requested, because it could not set the D-Bus " + f'property "{context.property_name}" belonging to ' + f'interface "{error.interface_name}" to "{context.value}". ' + f"It returned the following error: {dbus_message}." + ) + if isinstance(context, DPClientGetPropertyContext): # pragma: no cover return ( f"stratisd failed to perform the operation that you "