Embed: show an error when CSS failed to load

This commit is contained in:
Cat 2020-03-03 11:54:43 +01:00 committed by Thulinma
parent b9eb03a599
commit c17cfe9595
3 changed files with 23 additions and 12 deletions

View file

@ -363,9 +363,7 @@ var MistUtil = {
callback(xhr.response);
}
else if (errorCallback) {
xhr.onerror = function() {
errorCallback(xhr);
}
errorCallback(xhr);
}
};
if (errorCallback) {
@ -461,7 +459,12 @@ var MistUtil = {
}
cache[url] = d;
},function(){
throw "Failed to load CSS from "+url;
var d = "/*Failed to load*/";
for (var i in cache[url]) {
cache[url][i](d);
}
cache[url] = d;
});
}