(e)
| 78 | } |
| 79 | |
| 80 | function onError(e) { |
| 81 | // Some servers don't support the status command. If they are able to |
| 82 | // response with an error, then can consider the server ready. |
| 83 | if (e instanceof error.UnsupportedOperationError) { |
| 84 | resolve({}) |
| 85 | return |
| 86 | } |
| 87 | |
| 88 | if (Date.now() - start > timeout) { |
| 89 | reject(Error('Timed out waiting for the WebDriver server at ' + url)) |
| 90 | } else { |
| 91 | setTimeout(function () { |
| 92 | if (!done) { |
| 93 | checkServerStatus() |
| 94 | } |
| 95 | }, 50) |
| 96 | } |
| 97 | } |
| 98 | }) |
| 99 | } |
| 100 |