wacom: be more specific in the spark's original error code

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
pull/182/head
Peter Hutterer 2019-08-22 09:08:47 +10:00
parent 9fcd2b9517
commit fe75fc4342
1 changed files with 6 additions and 3 deletions

View File

@ -429,9 +429,12 @@ class WacomRegisterHelper(WacomProtocolLowLevelComm):
# expected
try:
self.p.execute(Interactions.CONNECT, uuid)
except tuhi.protocol.DeviceError:
# this is expected
pass
except tuhi.protocol.DeviceError as e:
if e.errorcode == tuhi.protocol.DeviceError.ErrorCode.GENERAL_ERROR:
# this is expected
pass
else:
raise e
# The "press button now command" on the spark
self.p.execute(Interactions.REGISTER_PRESS_BUTTON)