Catch if plugins aren't found globally (#4452)
This commit is contained in:
parent
06fb437625
commit
b0a98cc973
|
|
@ -81,12 +81,18 @@ export async function loadPlugins(pluginNames, options, context, queue) {
|
||||||
plugins.push(p);
|
plugins.push(p);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// try global
|
// try global
|
||||||
let { default: plugin } = await importGlobalSilent(name);
|
try {
|
||||||
if (plugin) {
|
let { default: plugin } = await importGlobalSilent(name);
|
||||||
let p = new plugin(options, context, queue);
|
if (plugin) {
|
||||||
plugins.push(p);
|
let p = new plugin(options, context, queue);
|
||||||
} else {
|
plugins.push(p);
|
||||||
console.error("Couldn't load plugin %s: %s", name, error_);
|
} else {
|
||||||
|
console.error("Couldn't load plugin %s: %s", name, error_);
|
||||||
|
// if it fails here, let it fail hard
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
console.error("Couldn't find/load plugin %s", name);
|
||||||
// if it fails here, let it fail hard
|
// if it fails here, let it fail hard
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue