mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-12-23 07:34:35 -06:00
Handle connection errors properly in the query tool. Fixes #3528
This commit is contained in:
parent
2eac2f43ac
commit
7b2c1bb9f8
@ -16,3 +16,4 @@ Bug fixes
|
||||
*********
|
||||
|
||||
| `Bug #3407 <https://redmine.postgresql.org/issues/3407>`_ - Fix keyboard shortcuts layout in the preferences panel.
|
||||
| `Bug #3528 <https://redmine.postgresql.org/issues/3528>`_ - Handle connection errors properly in the query tool.
|
||||
|
@ -332,8 +332,12 @@ def initialize_query_tool(sgid, sid, did=None):
|
||||
use_binary_placeholder=True,
|
||||
array_to_string=True)
|
||||
if connect:
|
||||
conn.connect()
|
||||
status, msg = conn.connect()
|
||||
if not status:
|
||||
app.logger.error(msg)
|
||||
return internal_server_error(errormsg=str(msg))
|
||||
except (ConnectionLost, SSHTunnelConnectionLost) as e:
|
||||
app.logger.error(e)
|
||||
raise
|
||||
except Exception as e:
|
||||
app.logger.error(e)
|
||||
|
@ -307,7 +307,7 @@ def start_query_tool(trans_id):
|
||||
|
||||
connect = 'connect' in request.args and request.args['connect'] == '1'
|
||||
|
||||
return StartRunningQuery(blueprint, current_app).execute(
|
||||
return StartRunningQuery(blueprint, current_app.logger).execute(
|
||||
sql, trans_id, session, connect
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user