Skip to content

Commit f5dcca8

Browse files
committed
Raise on Message creation failure. Addresses hardbyte#148.
1 parent aa10354 commit f5dcca8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

can/message.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def __init__(self, timestamp=0.0, is_remote_frame=False, extended_id=True,
3030
try:
3131
self.data = bytearray(data)
3232
except TypeError:
33-
logger.error("Couldn't create message from %r (%r)", data, type(data))
33+
err = "Couldn't create message from {} ({})".format(data, type(data))
34+
raise TypeError(err)
3435

3536
if dlc is None:
3637
self.dlc = len(self.data)

0 commit comments

Comments
 (0)