From 57cb8f4e5495e9a27eaa01cf78e41d56172439b9 Mon Sep 17 00:00:00 2001 From: Dorian Scholz Date: Tue, 30 May 2017 13:49:57 +0800 Subject: Show import error when loading driver, so the actual cause of the problem can be seen --- glucometer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glucometer.py b/glucometer.py index 19a47a8..c037d7c 100755 --- a/glucometer.py +++ b/glucometer.py @@ -65,10 +65,10 @@ def main(): try: driver = importlib.import_module('glucometerutils.drivers.' + args.driver) - except ImportError: + except ImportError as e: logging.error( - 'No driver "%s" found, please check your --driver parameter.', - args.driver) + 'Error importing driver "%s", please check your --driver parameter:\n%s', + args.driver, e) return 1 # This check needs to happen before we try to initialize the device, as the -- cgit v1.2.3