[UX] make error message explicit with useful information
authorLaurent Peuch <cortex@worlddomination.be>
Thu, 05 Dec 2019 18:43:19 +0100
changeset 12810 4a98b93ac5ac
parent 12809 9b809497978f
child 12811 03c0684e0160
[UX] make error message explicit with useful information
cubicweb/server/sqlutils.py
--- a/cubicweb/server/sqlutils.py	Thu Dec 05 18:41:32 2019 +0100
+++ b/cubicweb/server/sqlutils.py	Thu Dec 05 18:43:19 2019 +0100
@@ -278,8 +278,9 @@
         try:
             self.dbdriver = source_config['db-driver'].lower()
             dbname = source_config['db-name']
-        except KeyError:
-            raise ConfigurationError('missing some expected entries in sources file')
+        except KeyError as e:
+            raise ConfigurationError('missing some expected entries in sources file (do you have '
+                                     'a db-driver and a db-name keys?), error: %s' % e)
 
         dbhost = source_config.get('db-host')
         port = source_config.get('db-port')