diff --git a/packages/resource/resource.js b/packages/resource/resource.js index d7a8851..95e77f6 100644 --- a/packages/resource/resource.js +++ b/packages/resource/resource.js @@ -80,6 +80,8 @@ export class Resource extends decorate(class {}) { }); } return json; + }).catch((error) => { + console.error(`Failed loading '${uri}'.`); }); } diff --git a/packages/timing/animation-view.js b/packages/timing/animation-view.js index 5774437..162aef0 100644 --- a/packages/timing/animation-view.js +++ b/packages/timing/animation-view.js @@ -13,11 +13,13 @@ export class AnimationView extends Renderable { this.animation = animation; this.container = new Container(); if (hasGraphics) { - Image.load(this.animation.imageUri).then((image) => { - this.sprite = new Sprite(image); - this.container.addChild(this.sprite); - this.resetSourceRectangle(); - }); + if (this.animation.imageUri) { + Image.load(this.animation.imageUri).then((image) => { + this.sprite = new Sprite(image); + this.container.addChild(this.sprite); + this.resetSourceRectangle(); + }); + } } animation.on( ['directionChanged', 'indexChanged'], diff --git a/packages/timing/traits/animated.trait.js b/packages/timing/traits/animated.trait.js index edcfdac..5a65d08 100644 --- a/packages/timing/traits/animated.trait.js +++ b/packages/timing/traits/animated.trait.js @@ -128,6 +128,8 @@ export default class Animated extends decorate(Trait) { }); // Bounding box update. this.entity.updateVisibleBoundingBox(); + }).catch((error) => { + console.error(`Failed loading some or all animations.`); }); } @@ -156,6 +158,8 @@ export default class Animated extends decorate(Trait) { } }); this.setSpriteScale(); + }).catch((error) => { + console.error(`Failed loading some or all animation images.`); }); }