Skip to content

Commit

Permalink
Throw errors in renderToCanvas in portable stories
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed Aug 23, 2024
1 parent 9630148 commit dc9432a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,12 @@ export function composeStory<TRenderer extends Renderer = Renderer, TArgs extend
name: story.name,
tags: story.tags,
showMain: () => {},
showError: (error) => {},
showException: (error) => {},
showError: (error): void => {
throw new Error(`${error.title}\n${error.description}`);
},
showException: (error): void => {
throw error;
},
forceRemount: true,
storyContext: context,
storyFn: () => story.unboundStoryFn(context),
Expand Down

0 comments on commit dc9432a

Please sign in to comment.