Skip to content

Commit

Permalink
Merge pull request #1194 from storybooks/options-error-message
Browse files Browse the repository at this point in the history
Added error message for `addon-options`
  • Loading branch information
shilman authored Jun 5, 2017
2 parents d3368e8 + f000df0 commit b6c40e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions addons/options/src/preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ export function init() {
// ready. If called before, options will be cached until it can be sent.
export function setOptions(options) {
const channel = addons.getChannel();
if (!channel) {
throw new Error(
'Failed to find addon channel. This may be due to https://github.com/storybooks/storybook/issues/1192.'
);
}
channel.emit(EVENT_ID, { options });
}

0 comments on commit b6c40e5

Please sign in to comment.