From f25061b9e78d82435eb48b9024f736df9c5812ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Tue, 17 Jan 2017 00:13:35 +0000 Subject: freestyle: improve error message on command failure, fix comment. --- glucometerutils/support/freestyle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glucometerutils/support/freestyle.py b/glucometerutils/support/freestyle.py index db3dbee..b6dce38 100644 --- a/glucometerutils/support/freestyle.py +++ b/glucometerutils/support/freestyle.py @@ -110,7 +110,7 @@ class FreeStyleHidDevice(object): message_length = usb_packet[1] message_content = usb_packet[2:2+message_length] - # There appears to be a stray number of 22 01 03 messages being returned + # There appears to be a stray number of 22 01 xx messages being returned # by some devices after commands are sent. These do not appear to have # meaning, so ignore them and proceed to the next. if message_type == 0x22 and message_length == 1: @@ -145,7 +145,7 @@ class FreeStyleHidDevice(object): _verify_checksum(message, match.group('checksum')) if match.group('status') != 'OK': - raise exceptions.InvalidResponse(message) + raise exceptions.InvalidResponse(message or "Command failed") return message -- cgit v1.2.3