python-can icon indicating copy to clipboard operation
python-can copied to clipboard

Notifier thread closed when exception occurs on bus.recv expect repoting to listener only

Open prunith opened this issue 2 years ago • 2 comments

Describe the bug

When bus.recv raise an error notifier thread is stoped. Role of notifier is to cascade issue to the listener but not close itself

To Reproduce

Create CAN conection and produce failure on hardware that raise an error. Notifier catch the error but close the thread

Expected behavior

cascade exception to the listener to allow more precise control of failure

Additional context

OS and version: windows Python version: 3 python-can version: 4.2.2 python-can interface/s (if applicable): mine is Ixxat and error raised is "Error warning limit"

prunith avatar Sep 28 '23 14:09 prunith

I wouldn't call this a bug, but rather intended behavior. What is the full error stack trace and message? If your bus is operating correctly, there shouldn't be any errors raised. If I had to deduce from the error message, I would say your bus is potentially incorrectly configured.

lumagi avatar Oct 08 '23 06:10 lumagi

That changed in develop branch: #1645. The listeners can choose to ignore exceptions if Listener.on_error returns True

zariiii9003 avatar Oct 12 '23 19:10 zariiii9003