Skip to content
This repository was archived by the owner on Jul 12, 2020. It is now read-only.

Commit e7392a9

Browse files
Handle the error event of ChildProcess
Fixes #14
1 parent a465e5f commit e7392a9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

plugin_manager/git.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ module.exports = {
1515
proc.stderr.on('data', function(chk) {
1616
errors.push(chk.toString());
1717
})
18+
19+
proc.on('error', function(err) {
20+
return cb(err);
21+
});
1822

1923
proc.on('close', function (code) {
2024
if (code !== 0) {

plugin_manager/npm.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ module.exports = function(cwd) {
77
stdio: 'inherit',
88
cwd: cwd
99
})
10+
11+
proc.on('error', function(err) {
12+
return cb(err);
13+
});
14+
1015
proc.on('close', function (code) {
1116
if (code !== 0) {
1217
return cb(new Error('npm install failed with non-zero status '+code))

0 commit comments

Comments
 (0)