summaryrefslogtreecommitdiffstats
path: root/glucometerutils/glucometer.py
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.com>2019-07-01 21:49:29 +0200
committerDiego Elio Pettenò <flameeyes@flameeyes.com>2019-07-01 21:49:29 +0200
commit783ae018c61526f1b5e88f8d82e87c2955ba82bb (patch)
tree769bbd8ced4e2984a8615c6ae6d661f7ea97d970 /glucometerutils/glucometer.py
parenthandle device.get_datetime() value error exception (diff)
downloadglucometerutils-783ae018c61526f1b5e88f8d82e87c2955ba82bb.tar
glucometerutils-783ae018c61526f1b5e88f8d82e87c2955ba82bb.tar.gz
glucometerutils-783ae018c61526f1b5e88f8d82e87c2955ba82bb.tar.bz2
glucometerutils-783ae018c61526f1b5e88f8d82e87c2955ba82bb.tar.lz
glucometerutils-783ae018c61526f1b5e88f8d82e87c2955ba82bb.tar.xz
glucometerutils-783ae018c61526f1b5e88f8d82e87c2955ba82bb.tar.zst
glucometerutils-783ae018c61526f1b5e88f8d82e87c2955ba82bb.zip
Diffstat (limited to 'glucometerutils/glucometer.py')
-rwxr-xr-xglucometerutils/glucometer.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/glucometerutils/glucometer.py b/glucometerutils/glucometer.py
index 485b32b..14999a7 100755
--- a/glucometerutils/glucometer.py
+++ b/glucometerutils/glucometer.py
@@ -86,9 +86,9 @@ 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:
+ except exceptions.InvalidDateTime:
+ time_str = 'INVALID'
+ except NotImplementedError, ValueError: # Catch any leftover ValueError
time_str = 'N/A'
print("{device_info}Time: {time}".format(
device_info=str(device_info), time=time_str))