Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions qubes/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,10 @@ async def respond(self, src, meth, dest, arg, *, untrusted_payload):
len(untrusted_payload),
)

except ProtocolError:
except ProtocolError as err:
self.app.log.warning(
"protocol error for call %s+%s (%s → %s) "
"with payload of %d bytes",
"%s. In call %s+%s (%s → %s) with payload of %d bytes",
str(err),
meth,
arg,
src,
Expand Down
9 changes: 5 additions & 4 deletions qubes/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,17 @@ async def attach(self, assignment: DeviceAssignment):

try:
device = assignment.device
except ProtocolError:
# assignment matches no or top many devices
except ProtocolError as err:
# assignment matches zero or too many devices
# Add extra explanation to the user, but keep original error too.
raise ProtocolError(
f"Cannot attach ambiguous {assignment.devclass} device."
f"cannot attach ambiguous {assignment.devclass} device. {err}"
)

if isinstance(device, UnknownDevice):
raise ProtocolError(
f"{device.devclass} device not recognized "
f"in {device.port_id} port."
f"in {device.port_id} port"
)

if device in [ass.device for ass in self.get_attached_devices()]:
Expand Down