Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

fix: include exception details in coordinate click and add missing error logs

santosh-ageboldc9dae1b6bf0a
diff --git a/browser_use/browser/watchdogs/default_action_watchdog.py b/browser_use/browser/watchdogs/default_action_watchdog.py
index f56e4fa8f..e38777e9d 100644
--- a/browser_use/browser/watchdogs/default_action_watchdog.py
+++ b/browser_use/browser/watchdogs/default_action_watchdog.py
@@ -493,7 +493,7 @@ class DefaultActionWatchdog(BaseWatchdog):
try:
await asyncio.wait_for(self._click_element_node_impl(element_node), timeout=10.0)
except Exception as e:
- pass
+ self.logger.debug(f'Fallback click for page typing failed: {e}')
await self._type_to_page(event.text)
# Log with sensitive data protection
if event.is_sensitive:
diff --git a/browser_use/tools/service.py b/browser_use/tools/service.py
index 10be3018c..2eb65e809 100644
--- a/browser_use/tools/service.py
+++ b/browser_use/tools/service.py
@@ -668,7 +668,11 @@ class Tools(Generic[Context]):
tabs_before = {t.target_id for t in await browser_session.get_tabs()}
# Highlight the coordinate being clicked (truly non-blocking)
- asyncio.create_task(browser_session.highlight_coordinate_click(actual_x, actual_y))
+ create_task_with_error_handling(
+ browser_session.highlight_coordinate_click(actual_x, actual_y),
+ name='highlight_coordinate_click',
+ suppress_exceptions=True,
+ )
# Dispatch ClickCoordinateEvent - handler will check for safety and click
event = browser_session.event_bus.dispatch(
@@ -694,7 +698,7 @@ class Tools(Generic[Context]):
except BrowserError as e:
return handle_browser_error(e)
except Exception as e:
- error_msg = f'Failed to click at coordinates ({params.coordinate_x}, {params.coordinate_y}).'
+ error_msg = f'Failed to click at coordinates ({params.coordinate_x}, {params.coordinate_y}): {e}'
return ActionResult(error=error_msg)
async def _click_by_index(