Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return await f.create(name, queue, parameters).catch((reason) => {
if (!(reason instanceof Error)) {
reason = new Error(reason);
}
if (VError.hasCauseWithName(reason, 'BoxNotFound')) {
return;
}
throw new VError(
{
name: 'FactoryException',
message: 'ComponentFactory.create(%s) failed.',
info: {
factoryBaseURI: f.baseURI,
requestedBoxName: name,
},
cause: reason,
},
name
);
});