Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

machine

Package Overview
Dependencies
Maintainers
5
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

machine - npm Package Compare versions

Comparing version 9.1.0 to 9.1.1

36

lib/Machine.prototype.execSync.js

@@ -72,5 +72,20 @@ /**

// ensure `_data` exists and is an Error instance
if (_.isError(_data)) {
// TODO: if this error came from a machine internal to the implementation of THIS machine, add something to the error message+stack about that.
err = _data;
}
// (if not, build it as an error object using the exit definition)
if (!_.isError(_data)) {
err = new Error(util.format('`%s` triggered its `%s` exit', self.identity, exitName) + ((self.exits[exitName] && self.exits[exitName].description)?': '+self.exits[exitName].description:'') + '');
else {
var exitDef = self.exits[exitName];
var exitDescription = exitDef && exitDef.description;
var exitHasOutput = exitDef && !_.isUndefined(exitDef.example);
var errMsg = util.format(
'`%s` triggered its `%s` exit.\n%s%s',
self.identity,
exitName,
(exitDescription ? ('\nDescription:\n'+exitDescription+'\n') : ''),
(exitHasOutput ? ('\nOutput:\n'+util.inspect(_data, false, null)+'\n') : '')
);
err = new Error(errMsg);
// TODO: use a nice module to trim some of the crap from `machine` itself off of the stack.
err.code = exitName;

@@ -80,5 +95,2 @@ err.exit = exitName;

}
else {
err = _data;
}
};

@@ -92,2 +104,3 @@ });

var _err = new Error('Cannot use `.execSync()` with `'+identity+'` machine because, although it declares synchronous usage (i.e. `sync:true`), it is not actually synchronous.');
// TODO: use a nice module to trim some of the crap from `machine` itself off of the stack.
_err.code = 'E_MACHINE_INCONSISTENT';

@@ -107,5 +120,12 @@ return _err;

if (err) {
if (typeof err === 'object' && err instanceof Error) throw err;
if (typeof err === 'string') throw new Error(err);
throw new Error(util.inspect(err, false, null));
if (_.isError(err)) {
throw err;
}
if (_.isString(err)) {
err = new Error(err);
}
err = new Error(util.inspect(err, false, null));
// TODO: use a nice module to trim some of the crap from `machine` itself off of the stack.
throw err;
}

@@ -112,0 +132,0 @@

{
"name": "machine",
"version": "9.1.0",
"version": "9.1.1",
"description": "Configure and execute machines",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc