mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
[hotfix] handling json errors in explore view
This commit is contained in:
parent
89cb726284
commit
5bea3986b2
@ -150,15 +150,25 @@ const px = function () {
|
|||||||
return msg;
|
return msg;
|
||||||
},
|
},
|
||||||
error(msg, xhr) {
|
error(msg, xhr) {
|
||||||
|
let errorMsg = msg;
|
||||||
token.find('img.loading').hide();
|
token.find('img.loading').hide();
|
||||||
let err = msg ? '<div class="alert alert-danger">' + msg + '</div>' : '';
|
let errHtml = '';
|
||||||
|
try {
|
||||||
|
const o = JSON.parse(msg);
|
||||||
|
if (o.error) {
|
||||||
|
errorMsg = o.error;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// pass
|
||||||
|
}
|
||||||
|
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) {
|
||||||
err += '<div class="alert alert-danger">' + extendedMsg + '</div>';
|
errHtml += `<div class="alert alert-danger">${extendedMsg}</div>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
container.html(err);
|
container.html(errHtml);
|
||||||
container.show();
|
container.show();
|
||||||
$('span.query').removeClass('disabled');
|
$('span.query').removeClass('disabled');
|
||||||
$('#timer').addClass('btn-danger');
|
$('#timer').addClass('btn-danger');
|
||||||
|
@ -116,6 +116,7 @@ const controllerInterface = {
|
|||||||
getFilters: () => false,
|
getFilters: () => false,
|
||||||
clearFilter: () => {},
|
clearFilter: () => {},
|
||||||
removeFilter: () => {},
|
removeFilter: () => {},
|
||||||
|
filters: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
Loading…
Reference in New Issue
Block a user