flashtool: can bridge uuid detection fix

Handle exceptions if the conversion from USB serial number
to uuid fails for can bridge devices.  Abort detection as the
can bridge device cannot be flashed in one step.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2025-03-15 10:59:29 -04:00
parent 604b7e5a7d
commit 291c5da31a
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B

View File

@ -755,7 +755,15 @@ class CanSocket(BaseSocket):
f"Found Klipper USB-CAN bridge on {can_intf}, serial {serial_no}" f"Found Klipper USB-CAN bridge on {can_intf}, serial {serial_no}"
) )
if serial_no: if serial_no:
det_uuid = convert_usbsn_to_uuid(serial_no) try:
det_uuid = convert_usbsn_to_uuid(serial_no)
except Exception:
output_line(
f"Failed to convert can bridge serial number {serial_no} "
f"to a uuid for device {item.name}"
)
logging.exception("UUID conversion failed")
return
logging.info( logging.info(
f"Detected UUID: {det_uuid:x}, provided UUID: {self._uuid:x}" f"Detected UUID: {det_uuid:x}, provided UUID: {self._uuid:x}"
) )