Skip to content

Commit 7081722

Browse files
committed
fix: log for own browser env vars
1 parent 6c29bc1 commit 7081722

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

webui.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,18 @@ async def run_custom_agent(
171171
playwright = await async_playwright().start()
172172
chrome_exe = os.getenv("CHROME_PATH", "")
173173
chrome_use_data = os.getenv("CHROME_USER_DATA", "")
174+
175+
if not chrome_exe:
176+
raise ValueError("You selected use own browser, but CHROME_PATH environment variable is not set. Please set it to your Chrome executable path.")
177+
178+
if not os.path.exists(chrome_exe):
179+
raise ValueError(f"Chrome executable not found at {chrome_exe}")
180+
if not chrome_use_data:
181+
raise ValueError("You selected use own browser, but CHROME_USER_DATA environment variable is not set. Please set it to your Chrome user data directory.")
182+
183+
if not os.path.exists(os.path.expanduser(chrome_use_data)):
184+
raise ValueError(f"Chrome user data directory not found at {chrome_use_data}")
185+
174186
browser_context_ = await playwright.chromium.launch_persistent_context(
175187
user_data_dir=chrome_use_data,
176188
executable_path=chrome_exe,

0 commit comments

Comments
 (0)