Ensure that the query tool should display the proper error message while terminating the active session. Fixes #3591

This commit is contained in:
Yogesh Mahajan
2020-06-22 17:08:55 +05:30
committed by Akshay Joshi
parent 6012f49919
commit caebdcfa91
2 changed files with 7 additions and 2 deletions

View File

@@ -1404,15 +1404,19 @@ Failed to reset the connection to the server due to following error:
is_error = False
try:
status = self._wait_timeout(self.conn)
except psycopg2.OperationalError as op_er:
errmsg = \
self._formatted_exception_msg(op_er, formatted_exception_msg)
is_error = True
except psycopg2.Error as pe:
errmsg = self._formatted_exception_msg(pe, formatted_exception_msg)
is_error = True
if self.conn.closed:
raise ConnectionLost(
self.manager.sid,
self.db,
self.conn_id[5:]
)
errmsg = self._formatted_exception_msg(pe, formatted_exception_msg)
is_error = True
except OSError as e:
# Bad File descriptor
if e.errno == 9: