hardbyte / hardbyte/python-can

Handling cantimeout exception

Đang mở
#1,550 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
1.6k
Fork
697
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I have written a code that receives a message for certain timeout, if the timeout exceeds and no message was sent it raises the CanTimeoutError flag.
when i ran the program, the exception doesn't get executed.
this is the code i wrote
```
import can

with can.Bus(interface="socketcan", channel="vcan0") as bus:
try:
msg=bus.recv(1)
print(msg)
except can.CanTimeoutError:
print("timeout exceeded")
```

Does someone have any idea how to resolve this issue ?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.