Skip to content

Commit

Permalink
fix: onLoaded callback not run on spec error
Browse files Browse the repository at this point in the history
fixes #690
  • Loading branch information
RomanHotsiy committed Nov 6, 2018
1 parent bba40cd commit e77df0c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/StoreBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ export class StoreBuilder extends Component<StoreBuilderProps, StoreBuilderState
if (!spec) {
return undefined;
}
return new AppStore(spec, specUrl, options);
try {
return new AppStore(spec, specUrl, options);
} catch (e) {
if (this.props.onLoaded) {
this.props.onLoaded(e);
}
throw e;
}
}

componentDidMount() {
Expand Down

0 comments on commit e77df0c

Please sign in to comment.