qgiscloud / qgis-cloud-plugin

QGIS Plugin for publishing maps on www.qgiscloud.com
GNU General Public License v2.0
17 stars 13 forks source link

stack trace when accessing a DB that doesn't exist any more doesn't mention the failing DB #52

Closed tpo closed 3 years ago

tpo commented 3 years ago

when one of the DBs return by the qgiscloud API doesn't exist any more I get the following stack trace, that isn't very helpful since it doesn't mention the failing DB name:

Ein Fehler trat bei der Ausführung von Python-Code auf: 

psycopg2.OperationalError: ERROR:  pgbouncer cannot connect to server ERROR:  pgbouncer cannot connect to server 
Traceback (most recent call last):
  File "/home/tpo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgiscloud/qgiscloudplugindialog.py", line 1013, in update_data_sources_table_names
    self.ui.cbUploadDatabase.currentText())
  File "/home/tpo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgiscloud/qgiscloudplugindialog.py", line 1202, in fetch_schemas
    conn = self.db_connections.db(db).psycopg_connection()
  File "/home/tpo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgiscloud/db_connection_cfg.py", line 162, in psycopg_connection
    port=self.port
  File "/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: ERROR:  pgbouncer cannot connect to server
ERROR:  pgbouncer cannot connect to server

Python-Version: 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0] 
QGIS-Version: 3.16.4-Hannover Hannover, 654e76b3cb 
tpo commented 3 years ago

@hdus or @mhugent I have pushed a fix for this problem, I would be glad for a review + @hdus a translation of the error/format string. Thanks!