Comparing version 12.4.0 to 13.0.0-0
@@ -272,3 +272,2 @@ /** | ||
_err.reason = _err.message; | ||
_err.status = 500; | ||
return _err; | ||
@@ -275,0 +274,0 @@ })(); |
@@ -59,11 +59,11 @@ /** | ||
err.code = 'MACHINE_DEFINITION_INVALID'; | ||
err.status = 400; | ||
err.message = util.format( | ||
'Failed to instantiate machine from the specified machine definition.\n'+ | ||
'A machine definition should be an object with the following properties:\n'+ | ||
' • identity\n • inputs\n • exits\n • fn\n\n'+ | ||
'But the actual machine definition was:\n'+ | ||
'Failed to build the specified Node Machine definition.\n'+ | ||
'Machines should be defined as a dictionary (aka plain JavaScript object)\n'+ | ||
'with at least one property: `fn`. (See http:// node-machine.org/spec/machine)\n'+ | ||
'\n'+ | ||
'The specified machine definition is invalid:\n'+ | ||
'------------------------------------------------------\n'+ | ||
'%s\n'+ | ||
'------------------------------------------------------\n', | ||
'------------------------------------------------------', | ||
util.inspect(machineDefinition, false, null)); | ||
@@ -135,3 +135,2 @@ throw err; | ||
e.code = 'MACHINE_INPUT_INVALID'; | ||
e.status = 400; | ||
e.message = e.message + '\n' + util.format( | ||
@@ -163,3 +162,2 @@ 'Failed to instantiate machine "' + machineDefinition.friendlyName + '" from the specified machine definition.\n'+ | ||
err.code = 'MACHINE_INPUT_INVALID'; | ||
err.status = 400; | ||
return err; | ||
@@ -175,3 +173,2 @@ })(); | ||
err.code = 'MACHINE_INPUT_INVALID'; | ||
err.status = 400; | ||
return err; | ||
@@ -235,3 +232,2 @@ })(); | ||
e.code = 'MACHINE_EXIT_INVALID'; | ||
e.status = 400; | ||
throw e; | ||
@@ -388,10 +384,12 @@ } | ||
_callableMachineWrapper.exits = machineDefinition.exits; | ||
_callableMachineWrapper.identity = machineDefinition.identity; | ||
_callableMachineWrapper.friendlyName = machineDefinition.friendlyName; | ||
_callableMachineWrapper.description = machineDefinition.description; | ||
_callableMachineWrapper.extendedDescription = machineDefinition.extendedDescription; | ||
_callableMachineWrapper.moreInfoUrl = machineDefinition.moreInfoUrl; | ||
_callableMachineWrapper.sync = machineDefinition.sync; | ||
_callableMachineWrapper.sideEffects = machineDefinition.sideEffects; | ||
_callableMachineWrapper.habitat = machineDefinition.habitat; | ||
_callableMachineWrapper.maxRecursion = machineDefinition.maxRecursion; | ||
_callableMachineWrapper.timeout = machineDefinition.timeout; | ||
_callableMachineWrapper.sideEffects = machineDefinition.sideEffects; | ||
_callableMachineWrapper._rootMachine = machineDefinition._rootMachine; | ||
@@ -411,2 +409,3 @@ | ||
_callableMachineWrapper.id = machineDefinition.id; | ||
_callableMachineWrapper.identity = machineDefinition.identity;//<<can be deprecated _HERE_ at least; should always be dynamically attached if present-- never necessary in compact NM def | ||
//////////////////////////////////////////////////////////////////////////////////// | ||
@@ -413,0 +412,0 @@ |
@@ -23,3 +23,2 @@ /** | ||
_err.code = 'E_USAGE'; | ||
_err.status = 400; | ||
return _err; | ||
@@ -26,0 +25,0 @@ })(); |
@@ -57,8 +57,12 @@ /** | ||
// var err = new Error(util.format('`%s` machine: %d error(s) encountered validating inputs:\n', self.identity, errors.length, util.inspect(errors))); | ||
var err = new Error(util.format('`%s` machine encountered %d error(s) while validating runtime input values: ', self.identity, errors.length, _.pluck(errors, 'stack').join('\n') )); | ||
// err.code = errors[0].code; | ||
var errMsg = (function (){ | ||
var prettyPrintedValidationErrorsStr = _.map(errors, function (rttcValidationErr){ | ||
return ' • '+rttcValidationErr.message; | ||
}).join('\n'); | ||
return 'Could not run `'+self.identity+'` due to '+errors.length+' '+ | ||
'validation error'+(errors.length>1?'s':'')+':\n'+prettyPrintedValidationErrorsStr; | ||
})(); | ||
var err = new Error(errMsg); | ||
err.code = 'E_MACHINE_RUNTIME_VALIDATION'; | ||
err.machine = self.identity; | ||
err.reason = err.message; | ||
err.status = 400; | ||
err.machineInstance = self; | ||
err.errors = errors; | ||
@@ -65,0 +69,0 @@ return err; |
@@ -25,3 +25,2 @@ /** | ||
_err.code = 'E_USAGE'; | ||
_err.status = 400; | ||
return _err; | ||
@@ -43,3 +42,2 @@ })(); | ||
_err.code = 'E_USAGE'; | ||
_err.status = 400; | ||
return _err; | ||
@@ -46,0 +44,0 @@ })(); |
@@ -42,3 +42,2 @@ /** | ||
_err.reason = _err.message; | ||
// _err.status = 400; | ||
return _err; | ||
@@ -261,3 +260,2 @@ })()); | ||
_err.input = inputName; | ||
// _err.status = 400; | ||
return _err; | ||
@@ -272,3 +270,2 @@ })(); | ||
_err.input = inputName; | ||
// _err.status = 400; | ||
return _err; | ||
@@ -404,3 +401,2 @@ })(); | ||
_err.input = inputName; | ||
// _err.status = 400; | ||
return _err; | ||
@@ -407,0 +403,0 @@ })(); |
{ | ||
"name": "machine", | ||
"version": "12.4.0", | ||
"version": "13.0.0-0", | ||
"description": "Configure and execute machines", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
114775
2444
2