Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dashboard] improve error handling on dashboard #2624

Merged
merged 3 commits into from
Apr 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions superset/assets/javascripts/modules/superset.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,13 @@ 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 += (
'The server could not be reached. You may want to ' +
'verify your connection and try again.');
} else {
msg += 'An unknown error occurred. (Status: ' + status + ')';
}
}
return msg;
Expand All @@ -163,7 +166,9 @@ const px = function () {
} catch (e) {
// pass
}
errHtml = `<div class="alert alert-danger">${errorMsg}</div>`;
if (errorMsg) {
errHtml += `<div class="alert alert-danger">${errorMsg}</div>`;
}
if (xhr) {
const extendedMsg = this.getErrorMsg(xhr);
if (extendedMsg) {
Expand Down