From d55f7c076b8f465850adfb7bbed0c0d9dc8db88f Mon Sep 17 00:00:00 2001 From: nilshah98 Date: Tue, 31 Oct 2023 21:12:56 +0530 Subject: [PATCH] fix: reject with Error object instead of string --- src/utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.js b/src/utils.js index 3ae765f6..3459fed0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -247,9 +247,9 @@ export function evalSetCurrentStory({ waitFor }, story) { // resolve when rendered, reject on any other renderer event return new Promise((resolve, reject) => { channel.on('storyRendered', resolve); - channel.on('storyMissing', () => reject('Story Missing')); - channel.on('storyErrored', () => reject('Story Errored')); - channel.on('storyThrewException', () => reject('Story Threw Exception')); + channel.on('storyMissing', () => reject(new Error('Story Missing'))); + channel.on('storyErrored', () => reject(new Error('Story Errored'))); + channel.on('storyThrewException', () => reject(new Error('Story Threw Exception'))); }); }); }