You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by pi...@apache.org on 2022/02/01 05:41:58 UTC

[atlas] 01/02: ATLAS-4541 : Improve user error message text when search queries abruptly fail

This is an automated email from the ASF dual-hosted git repository.

pinal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git

commit 27f31c35121cbbfccc36de0c1974c95c00ebf2cd
Author: Farhan Khan <fa...@freestoneinfotech.com>
AuthorDate: Mon Jan 31 14:52:17 2022 +0530

    ATLAS-4541 : Improve user error message text when search queries abruptly fail
    
    Signed-off-by: Pinal Shah <pi...@freestoneinfotech.com>
---
 dashboardv2/public/js/views/search/SearchResultLayoutView.js | 8 +++++++-
 dashboardv3/public/js/views/search/SearchResultLayoutView.js | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index 04e6856..b98ef9a 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -212,8 +212,14 @@ define(['require',
                 });
                 this.listenTo(this.searchCollection, "error", function(model, response) {
                     this.hideLoader({ type: 'error' });
+                    if (response.readyState === 0) {
+                        Utils.notifyError({
+                            content: "Request aborted"
+                        });
+                        return;
+                    }
                     var responseJSON = response && response.responseJSON ? response.responseJSON : null,
-                        errorText = (responseJSON && (responseJSON.errorMessage || responseJSON.message || responseJSON.error)) || 'Invalid Expression';
+                        errorText = (responseJSON && (responseJSON.errorMessage || responseJSON.message || responseJSON.error || responseJSON.msgDesc)) || 'Something went wrong';
                     if (errorText) {
                         Utils.notifyError({
                             content: errorText
diff --git a/dashboardv3/public/js/views/search/SearchResultLayoutView.js b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
index c31db48..9837b5a 100644
--- a/dashboardv3/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
@@ -219,8 +219,14 @@ define(['require',
                 });
                 this.listenTo(this.searchCollection, "error", function(model, response) {
                     this.hideLoader({ type: 'error' });
+                    if (response.readyState === 0) {
+                        Utils.notifyError({
+                            content: "Request aborted"
+                        });
+                        return;
+                    }
                     var responseJSON = response && response.responseJSON ? response.responseJSON : null,
-                        errorText = (responseJSON && (responseJSON.errorMessage || responseJSON.message || responseJSON.error)) || 'Invalid Expression';
+                        errorText = (responseJSON && (responseJSON.errorMessage || responseJSON.message || responseJSON.error || responseJSON.msgDesc)) || 'Something went wrong';
                     if (errorText) {
                         Utils.notifyError({
                             content: errorText