You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by gr...@apache.org on 2017/11/13 05:24:22 UTC

[incubator-superset] branch master updated: [sqllab] fix wrong error msg (#3849)

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

graceguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 068c343  [sqllab] fix wrong error msg (#3849)
068c343 is described below

commit 068c343be0e7236117b8ed99b58abef841ed4cf5
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Sun Nov 12 21:24:20 2017 -0800

    [sqllab] fix wrong error msg (#3849)
    
    I was getting some "Could not connect to server" when there was
    a proper json payload with an `error` key, the change here makes sure to
    prioritize those messages over the generic one.
---
 superset/assets/javascripts/SqlLab/actions.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/superset/assets/javascripts/SqlLab/actions.js b/superset/assets/javascripts/SqlLab/actions.js
index e556302..2541ee5 100644
--- a/superset/assets/javascripts/SqlLab/actions.js
+++ b/superset/assets/javascripts/SqlLab/actions.js
@@ -153,10 +153,12 @@ export function runQuery(query) {
             msg = err.responseText;
           }
         }
-        if (textStatus === 'error' && errorThrown === '') {
-          msg = t('Could not connect to server');
-        } else if (msg === null) {
-          msg = `[${textStatus}] ${errorThrown}`;
+        if (msg === null) {
+          if (errorThrown) {
+            msg = `[${textStatus}] ${errorThrown}`;
+          } else {
+            msg = t('Unknown error');
+          }
         }
         if (msg.indexOf('CSRF token') > 0) {
           msg = t('Your session timed out, please refresh your page and try again.');

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <co...@superset.apache.org>'].