Bug report #16843

Updated by Giovanni Manghi over 7 years ago

*new description:*
If you open the processing toolbox without a data connection defined, the "Import into PostGIS" tool tosses an error in the log but gives the user no clean indication what has happened beyond the message log. Could the tool either tell you "there is no connection" or prompt you to create a connection if one doesn't exist?

@2017-07-14T23:48:11 2 Uncaught error while executing algorithm
Traceback (most recent call last):
File "C:/OSGEO4~1/apps/qgis-rel-dev/./python/plugins\processing\core\GeoAlgorithm.py", line 203, in execute
self.processAlgorithm(progress)
File "C:/OSGEO4~1/apps/qgis-rel-dev/./python/plugins\processing\algs\qgis\ImportIntoPostGIS.py", line 88, in processAlgorithm
connection = self.DB_CONNECTIONS[self.getParameterValue(self.DATABASE)]
IndexError: list index out of range@

*old description:*
If you open the processing toolbox without a data connection defined, the "Import into PostGIS" tool tosses an error in the log but gives the user no clean indication what has happened beyond the message log. Could the tool either tell you "there is no connection" or prompt you to create a connection if one doesn't exist?


@2017-07-10T21:22:51 2017-07-10T21:22:51 1 Traceback (most recent call last):
File "/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 271, in executeAlgorithm
dlg = AlgorithmDialog(alg)
File "/usr/share/qgis/python/plugins/processing/gui/AlgorithmDialog.py", line 80, in __init__
self.setMainWidget(self.getParametersPanel(alg, self))
File "/usr/share/qgis/python/plugins/processing/gui/AlgorithmDialog.py", line 96, in getParametersPanel
return ParametersPanel(parent, alg)
File "/usr/share/qgis/python/plugins/processing/gui/ParametersPanel.py", line 80, in __init__
self.initWidgets()
File "/usr/share/qgis/python/plugins/processing/gui/ParametersPanel.py", line 170, in initWidgets
wrapper.postInitialize(list(self.wrappers.values()))
File "/usr/share/qgis/python/plugins/processing/gui/wrappers_postgis.py", line 95, in postInitialize
self.setConnection(wrapper.value())
File "/usr/share/qgis/python/plugins/processing/gui/wrappers_postgis.py", line 108, in setConnection
self._database = GeoDB.from_name(connection)
File "/usr/share/qgis/python/plugins/processing/tools/postgis.py", line 184, in from_name
uri = uri_from_name(conn_name)
File "/usr/share/qgis/python/plugins/processing/tools/postgis.py", line 52, in uri_from_name
raise DbError(QCoreApplication.translate("PostGIS", 'There is no defined database connection "{0}".').format(conn_name))
processing.tools.postgis.DbError: MESSAGE: There is no defined database connection "".@ "".

Back