powershell catch error

This commit is contained in:
Sebastian Hildebrandt 2019-02-04 12:59:10 +01:00
parent 3aef4ed544
commit 5bf3819c23

View File

@ -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);
} }