Skip to content

Commit

Permalink
chore: add error for incorrect load function
Browse files Browse the repository at this point in the history
  • Loading branch information
Caele committed Mar 30, 2021
1 parent 87a172b commit 7ebf0c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apis/nucleus/src/sn/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export async function load(name, version, { config }, loader) {
const key = `${name}__${version}`;
if (!LOADED[key]) {
const sKey = `${name}${(version && ` v${version}`) || ''}`;
if (loader && typeof loader !== 'function') {
throw new Error(`load of visualization '${sKey}' is not a fuction, wrap load promise in function`);
}
const p = (loader || config.load)({
name,
version,
Expand Down

0 comments on commit 7ebf0c4

Please sign in to comment.