mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Better error handling
This commit is contained in:
parent
004f38190a
commit
1c74c9028c
1 changed files with 5 additions and 2 deletions
|
@ -39,7 +39,7 @@ const loadBitmap_ = function (costume, costumeAsset, runtime, rotationCenter) {
|
||||||
const onError = function () {
|
const onError = function () {
|
||||||
// eslint-disable-next-line no-use-before-define
|
// eslint-disable-next-line no-use-before-define
|
||||||
removeEventListeners();
|
removeEventListeners();
|
||||||
reject();
|
reject('Image load failed');
|
||||||
};
|
};
|
||||||
const onLoad = function () {
|
const onLoad = function () {
|
||||||
// eslint-disable-next-line no-use-before-define
|
// eslint-disable-next-line no-use-before-define
|
||||||
|
@ -166,7 +166,10 @@ const loadCostume = function (md5ext, costume, runtime, optVersion) {
|
||||||
return runtime.storage.load(assetType, md5, ext).then(costumeAsset => {
|
return runtime.storage.load(assetType, md5, ext).then(costumeAsset => {
|
||||||
costume.dataFormat = ext;
|
costume.dataFormat = ext;
|
||||||
return loadCostumeFromAsset(costume, costumeAsset, runtime, optVersion);
|
return loadCostumeFromAsset(costume, costumeAsset, runtime, optVersion);
|
||||||
});
|
})
|
||||||
|
.catch(e => {
|
||||||
|
log.error(e);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
Loading…
Reference in a new issue