Skip to content

Commit ad4a335

Browse files
committed
Better exception handling in browser_launcher
1 parent 8156534 commit ad4a335

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

seleniumbase/core/browser_launcher.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ def get_local_driver(browser_name, headless):
147147
firefox_driver = webdriver.Firefox(
148148
firefox_profile=profile, capabilities=firefox_capabilities)
149149
return firefox_driver
150-
except Exception:
150+
except Exception as e:
151+
if headless:
152+
raise Exception(e)
151153
return webdriver.Firefox()
152154
if browser_name == constants.Browser.INTERNET_EXPLORER:
153155
return webdriver.Ie()
@@ -179,5 +181,7 @@ def get_local_driver(browser_name, headless):
179181
# Run Chrome in full screen mode on MAC/Linux
180182
chrome_options.add_argument("--kiosk")
181183
return webdriver.Chrome(chrome_options=chrome_options)
182-
except Exception:
184+
except Exception as e:
185+
if headless:
186+
raise Exception(e)
183187
return webdriver.Chrome()

0 commit comments

Comments
 (0)