fix(plugins/browser): carry forward requests.RequestException wrapping

PR #25580 was authored before #2746 landed on main, so its plugin
versions of browser_use/browserbase/firecrawl ship without the
requests.RequestException → RuntimeError wrapping that 13c72fb4 added
to the legacy tools/browser_providers/ files for #2746. Cherry-picking
the PR + git rm'ing the legacy files (the migration's intent) would
silently revert that network-error fix.

Port the same try/except pattern into the three plugin create_session()
methods. Browser Use managed-mode keeps its raw-exception propagation
(idempotency-key retry semantics).

Co-authored-by: nidhi-singh02 <nidhi2894@gmail.com>
This commit is contained in:
teknium1 2026-05-17 04:02:05 -07:00 committed by Teknium
parent c74ff2c8ef
commit f36c89cd57
3 changed files with 68 additions and 48 deletions

View file

@ -82,12 +82,17 @@ class FirecrawlBrowserProvider(BrowserProvider):
body: Dict[str, object] = {"ttl": ttl}
response = requests.post(
f"{self._api_url()}/v2/browser",
headers=self._headers(),
json=body,
timeout=30,
)
try:
response = requests.post(
f"{self._api_url()}/v2/browser",
headers=self._headers(),
json=body,
timeout=30,
)
except requests.RequestException as exc:
raise RuntimeError(
f"Firecrawl API connection failed: {exc}"
) from exc
if not response.ok:
raise RuntimeError(