Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions src/stratis_cli/_error_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 "
Expand Down
Loading