Skip to content

Commit

Permalink
fix: reject with Error object instead of string
Browse files Browse the repository at this point in the history
  • Loading branch information
nilshah98 committed Oct 31, 2023
1 parent 36a5dce commit d55f7c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')));
});
});
}

0 comments on commit d55f7c0

Please sign in to comment.