Comparing version 13.0.0-12 to 13.0.0-13
@@ -65,5 +65,11 @@ /** | ||
// Make sure that no argins were configured for undeclared inputs. | ||
// Make sure that no argins were configured for undeclared inputs: | ||
// First get the code names of all of this machine's declared inputs. | ||
var allDeclaredInputCodeNames = _.keys(liveMachine.inputs); | ||
var unrecognizedInputCodeNames = _.difference(_.keys(argins), allDeclaredInputCodeNames); | ||
// Next get the code names of all configured arguments (excluding those configured with `undefined` values). | ||
var allConfiguredArgins = _.omit(argins, function(val, key) {return _.isUndefined(val);}); | ||
// Get the difference of the two to see if there are any configured arguments that don't match | ||
// any known input for this machine. | ||
var unrecognizedInputCodeNames = _.difference(_.keys(allConfiguredArgins), allDeclaredInputCodeNames); | ||
// If so, throw an error. | ||
if (unrecognizedInputCodeNames.length > 0) { | ||
@@ -70,0 +76,0 @@ throw flaverr('E_USAGE', new Error('Invalid usage: One or more argins were configured for inputs that are not recognized by this machine: `' + unrecognizedInputCodeNames.join(', ') + '`.')); |
@@ -662,3 +662,4 @@ /** | ||
err_forwarding.stack = getCombinedErrorStack(thisStack, liveMachine._configuredEnvironment.debug.stack); | ||
err_forwarding.stackModified = true; | ||
// Indicate that we've already massaged this stack, so we don't do it again. | ||
Object.defineProperty(err_forwarding, 'stackModified', {value: true}); | ||
@@ -759,3 +760,4 @@ // Copy our error message | ||
err.stack = getCombinedErrorStack(thisStack, liveMachine._configuredEnvironment.debug.stack); | ||
err.stackModified = true; | ||
// Indicate that we've already massaged this stack, so we don't do it again. | ||
Object.defineProperty(err, 'stackModified', {value: true}); | ||
@@ -814,3 +816,4 @@ // Trigger callback | ||
e.stack = getCombinedErrorStack(removeNonUserlandCallsFromStack(e.stack), liveMachine._configuredEnvironment.debug.stack); | ||
e.stackModified = true; | ||
// Indicate that we've already massaged this stack, so we don't do it again. | ||
Object.defineProperty(e, 'stackModified', {value: true}); | ||
@@ -817,0 +820,0 @@ // Replace the message |
@@ -249,6 +249,21 @@ /** | ||
value.stack = value.message + '\n' + getCombinedErrorStack(value.stack.split('\n').slice(1), machine._configuredEnvironment.debug.stack); | ||
value.stackModified = true; | ||
// Indicate that we've already massaged this stack, so we don't do it again. | ||
Object.defineProperty(value, 'stackModified', {value: true}); | ||
} | ||
} | ||
// ╔═╗┌┬┐┌┬┐ ┌─┐┬ ┬┌┬┐┌─┐┬ ┬┌┬┐ ┌─┐┌─┐┬─┐ ┬ ┬┌─┐┬┌┬┐ ┌┬┐┬┌─┐┌─┐ ┌─┐─┐ ┬┬┌┬┐┌─┐ | ||
// ╠═╣ ││ ││ │ ││ │ │ ├─┘│ │ │ ├┤ │ │├┬┘ └┐┌┘│ ││ ││ ││││└─┐│ ├┤ ┌┴┬┘│ │ └─┐ | ||
// ╩ ╩─┴┘─┴┘ └─┘└─┘ ┴ ┴ └─┘ ┴ └ └─┘┴└─ └┘ └─┘┴─┴┘ ┴ ┴┴└─┘└─┘ └─┘┴ └─┴ ┴ └─┘ | ||
else if (exitName !== 'success' && _.isUndefined(example) && _.isUndefined(value)) { | ||
// Create a new error with the name of the machine and exit that was triggered, and the description | ||
// of that exit if available. | ||
value = new Error('Machine `' + machine.identity + '` called its `' + exitName + '` exit' + (exitDef.description ? (': ' + exitDef.description) : '.')); | ||
// Make sure the error stack reaches all the way back to the beginning of the run, following asynchronous hops. | ||
value.stack = value.message + '\n' + getCombinedErrorStack(value.stack.split('\n').slice(1), machine._configuredEnvironment.debug.stack); | ||
// Indicate that we've already massaged this stack, so we don't do it again. | ||
Object.defineProperty(value, 'stackModified', {value: true}); | ||
} | ||
// ┬ ┬┌─┐┌┬┐┌─┐┌┬┐┌─┐ ┌─┐┌┐┌┬ ┬ ┌─┐┌┬┐┌─┐┌─┐┬┌─ | ||
@@ -255,0 +270,0 @@ // │ │├─┘ ││├─┤ │ ├┤ ├┤ │││└┐┌┘ └─┐ │ ├─┤│ ├┴┐ |
{ | ||
"name": "machine", | ||
"version": "13.0.0-12", | ||
"version": "13.0.0-13", | ||
"description": "Configure and execute machines", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
218129
3467
0