Skip to content

Commit

Permalink
[dashboard] improve error handling on dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Apr 14, 2017
1 parent baff0cb commit c5c0240
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions superset/assets/javascripts/modules/superset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -163,7 +164,10 @@ const px = function () {
} catch (e) {
// pass
}
errHtml = `<div class="alert alert-danger">${errorMsg}</div>`;
console.log(errorMsg);
if (errorMsg) {
errHtml += `<div class="alert alert-danger">${errorMsg}</div>`;
}
if (xhr) {
const extendedMsg = this.getErrorMsg(xhr);
if (extendedMsg) {
Expand Down

0 comments on commit c5c0240

Please sign in to comment.