powershell catch error
This commit is contained in:
parent
3aef4ed544
commit
5bf3819c23
12
lib/util.js
12
lib/util.js
@ -237,9 +237,17 @@ function powerShell(cmd) {
|
|||||||
child.kill();
|
child.kill();
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
|
child.on('error', function () {
|
||||||
|
child.kill();
|
||||||
|
resolve(result);
|
||||||
|
});
|
||||||
|
|
||||||
child.stdin.write(cmd + '\n');
|
try {
|
||||||
child.stdin.end();
|
child.stdin.write(cmd + '\n');
|
||||||
|
child.stdin.end();
|
||||||
|
} catch (e) {
|
||||||
|
reject(result)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
reject(result);
|
reject(result);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user