Skip to content

Commit bcd0c31

Browse files
[js] Handle rejection of the driver
If binding can't find the executable we need to handle the rejection not just the exit of the process
1 parent f275319 commit bcd0c31

File tree

1 file changed

+5
-1
lines changed
  • javascript/node/selenium-webdriver/io

1 file changed

+5
-1
lines changed

javascript/node/selenium-webdriver/io/exec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,16 @@ function exec(command, opt_options) {
134134
proc.unref()
135135
process.once('exit', onProcessExit)
136136

137-
const result = new Promise((resolve) => {
137+
const result = new Promise((resolve, reject) => {
138138
proc.once('exit', (code, signal) => {
139139
proc = null
140140
process.removeListener('exit', onProcessExit)
141141
resolve(new Result(code, signal))
142142
})
143+
144+
proc.once('error', err => {
145+
reject(err);
146+
})
143147
})
144148
return new Command(result, killCommand)
145149

0 commit comments

Comments
 (0)