Ensure Javascript errors during Query Tool execution are reported as such and not as Ajax errors.. Fixes #4564

This commit is contained in:
Aditya Toshniwal 2019-10-29 15:51:28 +00:00 committed by Dave Page
parent 18b7483cc4
commit 4f9d2de8cd
2 changed files with 20 additions and 13 deletions

View File

@ -26,6 +26,7 @@ Bug fixes
| `Issue #4459 <https://redmine.postgresql.org/issues/4459>`_ - Don't quote bigints when copying them from the Query Tool results grid.
| `Issue #4482 <https://redmine.postgresql.org/issues/4482>`_ - Ensure compression level is passed to pg_dump when backing up in directory format.
| `Issue #4483 <https://redmine.postgresql.org/issues/4483>`_ - Ensure the number of jobs can be specified when backing up in directory format.
| `Issue #4564 <https://redmine.postgresql.org/issues/4564>`_ - Ensure Javascript errors during Query Tool execution are reported as such and not as Ajax errors.
| `Issue #4730 <https://redmine.postgresql.org/issues/4730>`_ - Ensure all messages are retained in the Query Tool from long running queries.
| `Issue #4845 <https://redmine.postgresql.org/issues/4845>`_ - Fixed potential error in the properties dialog for the Code tab.
| `Issue #4850 <https://redmine.postgresql.org/issues/4850>`_ - Fixed an issue where Datetimepicker control opens when clicking on the label.

View File

@ -169,22 +169,28 @@ class ExecuteQuery {
self.enableSQLEditorButtons();
}
if (ExecuteQuery.wasConnectionLostToPythonServer(error.response)) {
if(error.response) {
if(ExecuteQuery.wasConnectionLostToPythonServer(error.response)) {
self.handleConnectionToServerLost();
return;
}
const errorData = error.response.data;
if (self.userManagement.isPgaLoginRequired(errorData)) {
return self.userManagement.pgaLogin();
}
let msg = ExecuteQuery.extractErrorMessage(errorData);
self.sqlServerObject.update_msg_history(false, msg);
// Highlight the error in the sql panel
self.sqlServerObject._highlight_error(msg);
} else if(error.request) {
self.handleConnectionToServerLost();
return;
} else {
console.error(error);
}
const errorData = error.response.data;
if (self.userManagement.isPgaLoginRequired(errorData)) {
return self.userManagement.pgaLogin();
}
let msg = ExecuteQuery.extractErrorMessage(errorData);
self.sqlServerObject.update_msg_history(false, msg);
// Highlight the error in the sql panel
self.sqlServerObject._highlight_error(msg);
});
}