Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unhandled exception in pdo read #306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions canopen/pdo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import logging
import binascii

from ..sdo import SdoAbortedError
from ..sdo import SdoAbortedError, SdoCommunicationError
from .. import objectdictionary
from .. import variable

Expand Down Expand Up @@ -327,21 +327,21 @@ def read(self) -> None:
if self.trans_type >= 254:
try:
self.inhibit_time = self.com_record[3].raw
except (KeyError, SdoAbortedError) as e:
except (KeyError, SdoAbortedError, SdoCommunicationError) as e:
logger.info("Could not read inhibit time (%s)", e)
else:
logger.info("Inhibit time is set to %d ms", self.inhibit_time)

try:
self.event_timer = self.com_record[5].raw
except (KeyError, SdoAbortedError) as e:
except (KeyError, SdoAbortedError, SdoCommunicationError) as e:
logger.info("Could not read event timer (%s)", e)
else:
logger.info("Event timer is set to %d ms", self.event_timer)

try:
self.sync_start_value = self.com_record[6].raw
except (KeyError, SdoAbortedError) as e:
except (KeyError, SdoAbortedError, SdoCommunicationError) as e:
logger.info("Could not read SYNC start value (%s)", e)
else:
logger.info("SYNC start value is set to %d ms", self.sync_start_value)
Expand Down