From 82e0f71643b4b06170a7e69b9f6b8a164ca835f3 Mon Sep 17 00:00:00 2001 From: DD Liu Date: Fri, 13 Sep 2019 16:13:21 -0400 Subject: [PATCH 1/2] Move error log to right place --- src/import/load-costume.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/import/load-costume.js b/src/import/load-costume.js index 31639f404..2d26cebdc 100644 --- a/src/import/load-costume.js +++ b/src/import/load-costume.js @@ -171,8 +171,7 @@ const fetchBitmapCanvas_ = function (costume, runtime, rotationCenter) { assetMatchesBase: scale === 1 && !textImageElement }; }) - .catch(error => { - log.warn(`${error.name}: ${error.message}`); + .catch(() => { // Clean up the text layer properties if it fails to load delete costume.textLayerMD5; delete costume.textLayerAsset; @@ -261,7 +260,8 @@ const loadCostumeFromAsset = function (costume, runtime, optVersion) { } if (costume.asset.assetType.runtimeFormat === AssetType.ImageVector.runtimeFormat) { return loadVector_(costume, runtime, rotationCenter, optVersion) - .catch(() => { + .catch(error => { + log.warn(`${error.name}: ${error.message}`); // Use default asset if original fails to load costume.assetId = runtime.storage.defaultAssetId.ImageVector; costume.asset = runtime.storage.get(costume.assetId); From cbb668a7eced8ba8b3a144a46f11667ad1b30e73 Mon Sep 17 00:00:00 2001 From: DD Liu Date: Mon, 16 Sep 2019 13:59:45 -0400 Subject: [PATCH 2/2] Update src/import/load-costume.js Thanks! Co-Authored-By: Karishma Chadha --- src/import/load-costume.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/import/load-costume.js b/src/import/load-costume.js index 2d26cebdc..6dcb3ff99 100644 --- a/src/import/load-costume.js +++ b/src/import/load-costume.js @@ -261,7 +261,7 @@ const loadCostumeFromAsset = function (costume, runtime, optVersion) { if (costume.asset.assetType.runtimeFormat === AssetType.ImageVector.runtimeFormat) { return loadVector_(costume, runtime, rotationCenter, optVersion) .catch(error => { - log.warn(`${error.name}: ${error.message}`); + log.warn(`Error loading vector image: ${error.name}: ${error.message}`); // Use default asset if original fails to load costume.assetId = runtime.storage.defaultAssetId.ImageVector; costume.asset = runtime.storage.get(costume.assetId);