From c5c0240f19ebe155ea18116579a295ad202b88ca Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Fri, 14 Apr 2017 15:32:34 -0700 Subject: [PATCH 1/3] [dashboard] improve error handling on dashboard --- superset/assets/javascripts/modules/superset.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/superset/assets/javascripts/modules/superset.js b/superset/assets/javascripts/modules/superset.js index 1fb0cd9864bb9..1098f152d6c2b 100644 --- a/superset/assets/javascripts/modules/superset.js +++ b/superset/assets/javascripts/modules/superset.js @@ -141,10 +141,11 @@ const px = function () { let msg = ''; if (!xhr.responseText) { const status = xhr.status; - msg += 'An unknown error occurred. (Status: ' + status + ')'; if (status === 0) { // This may happen when the worker in gunicorn times out - msg += ' Maybe the request timed out?'; + msg += 'Could not reach server'; + } else { + msg += 'An unknown error occurred. (Status: ' + status + ')'; } } return msg; @@ -163,7 +164,10 @@ const px = function () { } catch (e) { // pass } - errHtml = `
${errorMsg}
`; + console.log(errorMsg); + if (errorMsg) { + errHtml += `
${errorMsg}
`; + } if (xhr) { const extendedMsg = this.getErrorMsg(xhr); if (extendedMsg) { From dc6382b425e72e21b9c46eab5149ec11936b64e6 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 17 Apr 2017 16:59:09 -0700 Subject: [PATCH 2/3] lint --- superset/assets/javascripts/modules/superset.js | 1 - 1 file changed, 1 deletion(-) diff --git a/superset/assets/javascripts/modules/superset.js b/superset/assets/javascripts/modules/superset.js index 1098f152d6c2b..4b7ac426c6508 100644 --- a/superset/assets/javascripts/modules/superset.js +++ b/superset/assets/javascripts/modules/superset.js @@ -164,7 +164,6 @@ const px = function () { } catch (e) { // pass } - console.log(errorMsg); if (errorMsg) { errHtml += `
${errorMsg}
`; } From 602bb0741846a35993ef51e889c5862834e9d9a3 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Tue, 18 Apr 2017 12:47:19 -0700 Subject: [PATCH 3/3] More wordy error msg --- superset/assets/javascripts/modules/superset.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/superset/assets/javascripts/modules/superset.js b/superset/assets/javascripts/modules/superset.js index 4b7ac426c6508..9a3de66abba73 100644 --- a/superset/assets/javascripts/modules/superset.js +++ b/superset/assets/javascripts/modules/superset.js @@ -143,7 +143,9 @@ const px = function () { const status = xhr.status; if (status === 0) { // This may happen when the worker in gunicorn times out - msg += 'Could not reach server'; + msg += ( + 'The server could not be reached. You may want to ' + + 'verify your connection and try again.'); } else { msg += 'An unknown error occurred. (Status: ' + status + ')'; }