serialhdl: Catch os.error on can.interface.Bus() call
It seems opening the canbus socket can sometimes throw an os.error (in addition to can.CanError). Catch that error to avoid Klipper reporting an internal error. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
38e79dffb6
commit
0245073c55
|
@ -136,7 +136,7 @@ class SerialReader:
|
||||||
can_filters=filters,
|
can_filters=filters,
|
||||||
bustype='socketcan')
|
bustype='socketcan')
|
||||||
bus.send(set_id_msg)
|
bus.send(set_id_msg)
|
||||||
except can.CanError as e:
|
except (can.CanError, os.error) as e:
|
||||||
logging.warn("%sUnable to open CAN port: %s",
|
logging.warn("%sUnable to open CAN port: %s",
|
||||||
self.warn_prefix, e)
|
self.warn_prefix, e)
|
||||||
self.reactor.pause(self.reactor.monotonic() + 5.)
|
self.reactor.pause(self.reactor.monotonic() + 5.)
|
||||||
|
|
Loading…
Reference in New Issue