@ionic/utils-subprocess
Advanced tools
Comparing version 2.1.14 to 3.0.0
@@ -21,10 +21,6 @@ /// <reference types="node" /> | ||
readonly name = "SubprocessError"; | ||
message: string; | ||
stack: string; | ||
code?: typeof ERROR_COMMAND_NOT_FOUND | typeof ERROR_NON_ZERO_EXIT | typeof ERROR_SIGNAL_EXIT; | ||
error?: Error; | ||
output?: string; | ||
signal?: string; | ||
exitCode?: number; | ||
constructor(message: string); | ||
} | ||
@@ -31,0 +27,0 @@ export interface SubprocessOptions extends SpawnOptions { |
@@ -37,7 +37,5 @@ "use strict"; | ||
class SubprocessError extends Error { | ||
constructor(message) { | ||
super(message); | ||
constructor() { | ||
super(...arguments); | ||
this.name = 'SubprocessError'; | ||
this.message = message; | ||
this.stack = (new Error()).stack || ''; | ||
} | ||
@@ -111,9 +109,8 @@ } | ||
if (error.code === 'ENOENT') { | ||
err = new SubprocessError('Command not found.'); | ||
err = new SubprocessError('Command not found.', { cause: error }); | ||
err.code = exports.ERROR_COMMAND_NOT_FOUND; | ||
} | ||
else { | ||
err = new SubprocessError('Command error.'); | ||
err = new SubprocessError('Command error.', { cause: error }); | ||
} | ||
err.error = error; | ||
reject(err); | ||
@@ -120,0 +117,0 @@ }); |
{ | ||
"name": "@ionic/utils-subprocess", | ||
"version": "2.1.14", | ||
"version": "3.0.0", | ||
"description": "Subprocess utils for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
14729
326