-
Notifications
You must be signed in to change notification settings - Fork 675
Expand file tree
/
Copy pathexceptions.py
More file actions
58 lines (38 loc) · 1.25 KB
/
exceptions.py
File metadata and controls
58 lines (38 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""
Ctypes wrapper module for IXXAT Virtual CAN Interface V4 on win32 systems
Copyright (C) 2016 Giuseppe Corbelli <giuseppe.corbelli@weightpack.com>
Copyright (C) 2019 Marcel Kanter <marcel.kanter@googlemail.com>
"""
from can import (
CanInitializationError,
CanOperationError,
CanTimeoutError,
)
__all__ = [
"VCIBusCouplingError",
"VCIBusOffError",
"VCIDataOverrunError",
"VCIDeviceNotFoundError",
"VCIError",
"VCIErrorLimitExceededError",
"VCIRxQueueEmptyError",
"VCITimeout",
]
class VCITimeout(CanTimeoutError):
"""Wraps the VCI_E_TIMEOUT error"""
class VCIError(CanOperationError):
"""Try to display errors that occur within the wrapped C library nicely."""
class VCIRxQueueEmptyError(VCIError):
"""Wraps the VCI_E_RXQUEUE_EMPTY error"""
def __init__(self):
super().__init__("Receive queue is empty")
class VCIBusOffError(VCIError):
"""Controller is in BUSOFF state"""
class VCIErrorLimitExceededError(VCIError):
"""overrun of error counter occurred"""
class VCIDataOverrunError(VCIError):
"""data overrun in receive buffer occurred"""
class VCIBusCouplingError(VCIError):
"""Bus coupling error occurred"""
class VCIDeviceNotFoundError(CanInitializationError):
pass