Handle a potential error case in the connection status monitoring.

When you disconnect the server with an open sqleditor tab, exception
 occurs at the back end. Also, after connecting server, the sqleditor
 is not able to connect back because of the exception.
This commit is contained in:
Aditya Toshniwal
2018-06-05 11:57:56 +01:00
committed by Dave Page
parent 20ea8a69f5
commit 920934759f

View File

@@ -1480,19 +1480,24 @@ def query_tool_status(trans_id):
if conn and trans_obj and session_obj:
status = conn.transaction_status()
# Check for the asynchronous notifies statements.
conn.check_notifies(True)
notifies = conn.get_notifies()
if status is not None:
# Check for the asynchronous notifies statements.
conn.check_notifies(True)
notifies = conn.get_notifies()
return make_json_response(
data={
'status': status,
'message': gettext(
CONNECTION_STATUS_MESSAGE_MAPPING.get(status),
),
'notifies': notifies
}
)
return make_json_response(
data={
'status': status,
'message': gettext(
CONNECTION_STATUS_MESSAGE_MAPPING.get(status),
),
'notifies': notifies
}
)
else:
return internal_server_error(
errormsg=gettext("Transaction status check failed.")
)
else:
return internal_server_error(
errormsg=gettext("Transaction status check failed.")