Skip to content

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

InterruptedError is due to user interrupting, so should be warning

LarsenCundricdeea28b4bb2f
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 1144f5635..c37be5203 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -849,7 +849,8 @@ class Agent(Generic[Context, AgentStructuredOutput]):
# Handle InterruptedError specially
if isinstance(error, InterruptedError):
error_msg = 'The agent was interrupted mid-step' + (f' - {str(error)}' if str(error) else '')
- self.logger.error(f'{error_msg}')
+ # NOTE: This is not an error, it's a normal part of the execution when the user interrupts the agent
+ self.logger.warning(f'{error_msg}')
return
# Handle all other exceptions