fix: call onLoaded if specs are not found (#2182)

This commit is contained in:
Alex Varchuk 2022-10-21 17:15:22 +03:00 committed by GitHub
parent 187e555558
commit 0753bbea4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,9 @@ export function StoreBuilder(props: StoreBuilderProps) {
const resolved = await loadAndBundleSpec(spec || specUrl!);
setResolvedSpec(resolved);
} catch (e) {
if (onLoaded) {
onLoaded(e);
}
setError(e);
throw e;
}