From 1c74c9028cf85db185a56f2a71edbe9e490ed65d Mon Sep 17 00:00:00 2001 From: DD Liu Date: Thu, 12 Jul 2018 17:18:38 -0400 Subject: [PATCH] Better error handling --- src/import/load-costume.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/import/load-costume.js b/src/import/load-costume.js index 7780eb437..932e1fc8a 100644 --- a/src/import/load-costume.js +++ b/src/import/load-costume.js @@ -39,7 +39,7 @@ const loadBitmap_ = function (costume, costumeAsset, runtime, rotationCenter) { const onError = function () { // eslint-disable-next-line no-use-before-define removeEventListeners(); - reject(); + reject('Image load failed'); }; const onLoad = function () { // 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 => { costume.dataFormat = ext; return loadCostumeFromAsset(costume, costumeAsset, runtime, optVersion); - }); + }) + .catch(e => { + log.error(e); + }); }; module.exports = {