Skip to content

Commit

Permalink
Added error message for addon-options
Browse files Browse the repository at this point in the history
See #1192 and #815
  • Loading branch information
tmeasday committed Jun 5, 2017
1 parent d3368e8 commit f000df0
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 f000df0

Please sign in to comment.