diff --git a/packages/display/src/Container.js b/packages/display/src/Container.js index c408292..ae08bfd 100644 --- a/packages/display/src/Container.js +++ b/packages/display/src/Container.js @@ -173,7 +173,7 @@ { if (index < 0 || index >= this.children.length) { - throw new Error('The supplied index is out of bounds'); + throw new Error(`The index ${index} supplied is out of bounds ${this.children.length}`); } const currentIndex = this.getChildIndex(child); diff --git a/packages/display/src/Container.js b/packages/display/src/Container.js index c408292..ae08bfd 100644 --- a/packages/display/src/Container.js +++ b/packages/display/src/Container.js @@ -173,7 +173,7 @@ { if (index < 0 || index >= this.children.length) { - throw new Error('The supplied index is out of bounds'); + throw new Error(`The index ${index} supplied is out of bounds ${this.children.length}`); } const currentIndex = this.getChildIndex(child); diff --git a/packages/display/test/Container.js b/packages/display/test/Container.js index c92e220..6c440ac 100644 --- a/packages/display/test/Container.js +++ b/packages/display/test/Container.js @@ -314,8 +314,8 @@ container.addChild(child); - expect(() => container.setChildIndex(child, -1)).to.throw('The supplied index is out of bounds'); - expect(() => container.setChildIndex(child, 1)).to.throw('The supplied index is out of bounds'); + expect(() => container.setChildIndex(child, -1)).to.throw('The index -1 supplied is out of bounds 1'); + expect(() => container.setChildIndex(child, 1)).to.throw('The index 1 supplied is out of bounds 1'); }); it('should throw when child does not belong', function ()