Make easier to read console error message in case of connection problem.
authorEdouard Tisserant
Mon, 10 Dec 2018 11:22:43 +0100
changeset 2469 e8760be772d5
parent 2468 046303391dea
child 2470 590f85412835
Make easier to read console error message in case of connection problem.
ProjectController.py
connectors/__init__.py
--- a/ProjectController.py	Wed Dec 05 14:05:35 2018 +0100
+++ b/ProjectController.py	Mon Dec 10 11:22:43 2018 +0100
@@ -1777,10 +1777,10 @@
         # Get connector from uri
         try:
             self._SetConnector(connectors.ConnectorFactory(uri, self))
-        except Exception:
+        except Exception as e:
             self.logger.write_error(
-                _("Exception while connecting %s!\n") % uri)
-            self.logger.write_error(traceback.format_exc())
+                _("Exception while connecting to '%s': %s\n") % (uri, str(e)))
+            #self.logger.write_error(traceback.format_exc())
 
         # Did connection success ?
         if self._connector is None:
--- a/connectors/__init__.py	Wed Dec 05 14:05:35 2018 +0100
+++ b/connectors/__init__.py	Mon Dec 10 11:22:43 2018 +0100
@@ -86,6 +86,9 @@
     # first call to import the module, 
     # then call with parameters to create the class
     connector_specific_class = connectors[scheme]()(uri, confnodesroot)
+    
+    if connector_specific_class is None:
+        return None
 
     # new class inheriting from generic and specific connector base classes
     return ClassType(_scheme + "_connector",