@forestadmin/context
Advanced tools
Comparing version 1.35.4 to 1.36.0
{ | ||
"name": "@forestadmin/context", | ||
"version": "1.35.4", | ||
"version": "1.36.0", | ||
"description": "Minimal context management helper for applications and libraries.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -131,7 +131,11 @@ const Metadata = require('./metadata'); | ||
addUsingFunction(path, name, factoryFunction, options) { | ||
this._metadata.add(path, name, 'function*', factoryFunction, options); | ||
const bag = this.get(); | ||
const theFunction = factoryFunction(bag); | ||
this._setNewValue(name, theFunction, options); | ||
return this; | ||
try { | ||
this._metadata.add(path, name, 'function*', factoryFunction, options); | ||
const bag = this.get(); | ||
const theFunction = factoryFunction(bag); | ||
this._setNewValue(name, theFunction, options); | ||
return this; | ||
} catch (cause) { | ||
throw new Error(`Using factory function for path "${path}/${name}" - ${cause.message}`, { cause }); | ||
} | ||
} | ||
@@ -138,0 +142,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61702
700