Skip to content

Commit

Permalink
properly handle process start error
Browse files Browse the repository at this point in the history
  • Loading branch information
toddtarsi committed Dec 27, 2023
1 parent de0c5f5 commit d108fe4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/selenium-ide/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "selenium-ide",
"version": "4.0.1-alpha.70",
"version": "4.0.1-alpha.71",
"private": false,
"description": "Selenium IDE electron app",
"author": "Todd <tarsitodd@gmail.com>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ export default class SystemController extends BaseController {
loggerWindow.show()
// If automated, assume we already have a chromedriver process running
if (!isAutomated) {
try {
await this.session.driver.startProcess(
this.session.store.get('browserInfo')
)
} catch (e) {
const startupError = await this.session.driver.startProcess(
this.session.store.get('browserInfo')
)
if (startupError) {
console.warn(`
Failed to locate non-electron driver on startup,
Resetting to electron driver.
Expand All @@ -70,12 +69,12 @@ export default class SystemController extends BaseController {
useBidi: false,
version: '',
})
const startupError = await this.session.driver.startProcess(
const fallbackStartupError = await this.session.driver.startProcess(
this.session.store.get('browserInfo')
)
if (startupError) {
if (fallbackStartupError) {
await this.crash(
`Unable to startup due to chromedriver error: ${startupError}`
`Unable to startup due to chromedriver error: ${fallbackStartupError}`
)
}
}
Expand Down

0 comments on commit d108fe4

Please sign in to comment.