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

Resolve AttributeError within NicanError #1806

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

vijaysubbiah20
Copy link
Contributor

Resolves the below error:

Exception in thread can.notifier for bus "NI-CAN: CAN0":
Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312-32\Lib\threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312-32\Lib\threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312-32\Lib\site-packages\can\notifier.py", line 124, in _rx_thread
    if msg := bus.recv(self.timeout):
              ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312-32\Lib\site-packages\can\bus.py", line 126, in recv
    msg, already_filtered = self._recv_internal(timeout=time_left)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312-32\Lib\site-packages\can\interfaces\nican.py", line 301, in _recv_internal
    nican.ncWaitForState(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312-32\Lib\site-packages\can\interfaces\nican.py", line 120, in check_status
    raise error_class(function, result, arguments)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312-32\Lib\site-packages\can\interfaces\nican.py", line 92, in __init__
    message=f"{function} failed: {get_error_message(self.error_code)}",
                                                    ^^^^^^^^^^^^^^^
AttributeError: 'NicanOperationError' object has no attribute 'error_code'

@zariiii9003
Copy link
Collaborator

Thanks!

@zariiii9003 zariiii9003 merged commit 174d560 into hardbyte:main Jun 27, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants