Use BoxError instead of Error in all places

This moves everything other than the addon code and some 'done' logic
This commit is contained in:
Girish Ramakrishnan
2019-12-04 10:29:06 -08:00
parent 3623831390
commit 30eccfb54b
17 changed files with 45 additions and 36 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ exports = module.exports = {
};
var assert = require('assert'),
BoxError = require('./boxerror.js'),
child_process = require('child_process'),
debug = require('debug')('box:shell'),
once = require('once'),
@@ -60,7 +61,7 @@ function spawn(tag, file, args, options, callback) {
if (code || signal) debug(tag + ' code: %s, signal: %s', code, signal);
if (code === 0) return callback(null);
var e = new Error(util.format(tag + ' exited with error %s signal %s', code, signal));
var e = new BoxError(BoxError.SPAWN_ERROR, `${tag} exited with error ${code} signal ${signal}`);
e.code = code;
e.signal = signal;
callback(e);