From 7c5f0e7ae0cfaa2c66b610a6c70171bb054f80c5 Mon Sep 17 00:00:00 2001 From: matmutant Date: Mon, 1 Jul 2019 20:59:29 +0200 Subject: handle device.get_datetime() value error exception --- glucometerutils/glucometer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/glucometerutils/glucometer.py b/glucometerutils/glucometer.py index 3f4ad4d..485b32b 100755 --- a/glucometerutils/glucometer.py +++ b/glucometerutils/glucometer.py @@ -86,6 +86,8 @@ def main(): if args.action == 'info': try: time_str = device.get_datetime() + except ValueError: + time_str = 'N/A' #handles value error exception for when time format found isn't expected except NotImplementedError: time_str = 'N/A' print("{device_info}Time: {time}".format( -- cgit v1.2.3