Skip to content

fix: resolve TypeError when handling Systec CAN error codes - #2099

Open
jonahdagher wants to merge 1 commit into
hardbyte:mainfrom
jonahdagher:fix-2077-systec-unhashable-error
Open

fix: resolve TypeError when handling Systec CAN error codes#2099
jonahdagher wants to merge 1 commit into
hardbyte:mainfrom
jonahdagher:fix-2077-systec-unhashable-error

Conversation

@jonahdagher

@jonahdagher jonahdagher commented Sep 2, 2026

Copy link
Copy Markdown

Summary of Changes

  • UcanException.__init__ looked up the error message using self._error_message_mapping.get(result, "unknown"), but result is a ReturnCode type which is unhashable. This line raised TypeError: unhashable type instead of raising the intended error, masking the real hardware issue.

  • Fixed by using result.value (a plain int) for the lookup.

Related Issues / Pull Requests

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Other (please describe):

Checklist

  • I have followed the contribution guide.
  • I have added or updated tests as appropriate.
  • I have added or updated documentation as appropriate.
  • I have added a news fragment for towncrier.
  • All checks and tests pass (tox).

@mergify

mergify Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhashable type for Systec interface errors

1 participant