aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/serialhdl.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2023-06-17 19:29:07 -0400
committerKevin O'Connor <kevin@koconnor.net>2023-06-17 19:32:06 -0400
commit0245073c550bba95f071893c68120dbe2a5d8219 (patch)
tree27c2a9d47799c2ddf4fd9361471e1b066d87ce1a /klippy/serialhdl.py
parent38e79dffb68fd522e6b83f47515691afa12898fb (diff)
downloadkutter-0245073c550bba95f071893c68120dbe2a5d8219.tar.gz
kutter-0245073c550bba95f071893c68120dbe2a5d8219.tar.xz
kutter-0245073c550bba95f071893c68120dbe2a5d8219.zip
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>
Diffstat (limited to 'klippy/serialhdl.py')
-rw-r--r--klippy/serialhdl.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/klippy/serialhdl.py b/klippy/serialhdl.py
index 02857993..f3c4ed99 100644
--- a/klippy/serialhdl.py
+++ b/klippy/serialhdl.py
@@ -136,7 +136,7 @@ class SerialReader:
can_filters=filters,
bustype='socketcan')
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",
self.warn_prefix, e)
self.reactor.pause(self.reactor.monotonic() + 5.)