Skip to content

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

Update browser_use/agent/service.py

Anish Hiranandani96456958fab0
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 21ab7d87f..bd5817352 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -545,7 +545,7 @@ class Agent(Generic[Context]):
output = self.llm.invoke(input_messages)
except Exception as e:
logger.error(f'Failed to invoke model: {str(e)}')
- raise LLMException(401, 'Failed to invoke model')
+ raise LLMException(401, 'LLM API call failed') from e
# TODO: currently invoke does not return reasoning_content, we should override invoke
output.content = self._remove_think_tags(str(output.content))
try: