mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
[dashboard] improve error handling on dashboard (#2624)
* [dashboard] improve error handling on dashboard * lint * More wordy error msg
This commit is contained in:
parent
67a85b9831
commit
f40499e550
@ -129,10 +129,13 @@ const px = function () {
|
|||||||
let msg = '';
|
let msg = '';
|
||||||
if (!xhr.responseText) {
|
if (!xhr.responseText) {
|
||||||
const status = xhr.status;
|
const status = xhr.status;
|
||||||
msg += 'An unknown error occurred. (Status: ' + status + ')';
|
|
||||||
if (status === 0) {
|
if (status === 0) {
|
||||||
// This may happen when the worker in gunicorn times out
|
// 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;
|
return msg;
|
||||||
@ -151,7 +154,9 @@ const px = function () {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
errHtml = `<div class="alert alert-danger">${errorMsg}</div>`;
|
if (errorMsg) {
|
||||||
|
errHtml += `<div class="alert alert-danger">${errorMsg}</div>`;
|
||||||
|
}
|
||||||
if (xhr) {
|
if (xhr) {
|
||||||
const extendedMsg = this.getErrorMsg(xhr);
|
const extendedMsg = this.getErrorMsg(xhr);
|
||||||
if (extendedMsg) {
|
if (extendedMsg) {
|
||||||
|
Loading…
Reference in New Issue
Block a user