From 354c84d750b85974075f8b9e01cc8e09bc2001dc Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 21 Aug 2019 16:33:23 +1000 Subject: [PATCH] wacom: switch two exceptions to a the protocol types Signed-off-by: Peter Hutterer --- tuhi/wacom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tuhi/wacom.py b/tuhi/wacom.py index bb4fa1c..01d71f9 100644 --- a/tuhi/wacom.py +++ b/tuhi/wacom.py @@ -24,7 +24,7 @@ from gi.repository import GObject from .drawing import Drawing from .uhid import UHIDDevice import tuhi.protocol -from tuhi.protocol import NordicData, Interactions, Mode, ProtocolVersion, StrokeFile +from tuhi.protocol import NordicData, Interactions, Mode, ProtocolVersion, StrokeFile, UnexpectedDataError from .util import list2hex, flatten from tuhi.config import TuhiConfig @@ -865,7 +865,7 @@ class WacomProtocolSlate(WacomProtocolSpark): pen_data = self.pen_data_buffer self.pen_data_buffer = [] if crc != binascii.crc32(bytes(pen_data)): - raise WacomCorruptDataException("CRCs don't match") + raise UnexpectedDataError(pen_data, message='CRCs do not match') return pen_data @@ -983,7 +983,7 @@ class WacomDevice(GObject.Object): } if protocol not in protocols: - raise WacomCorruptDataException(f'Protocol "{protocol}" not implemented') + raise NotImplementedError(f'Protocol "{protocol}" not implemented') pclass = protocols[protocol] self._wacom_protocol = pclass(self._device, self._uuid)