fix exception

This commit is contained in:
ThePhaseless
2025-08-17 00:38:37 +00:00
parent e875a9b0de
commit 80315fc611
+16 -10
View File
@@ -28,16 +28,22 @@ def get_sb(
detail="SOCKS5 proxy with authentication is not supported. Check README for more info.",
)
with SB(
uc=True,
test=True,
headless=USE_HEADLESS,
xvfb=USE_XVFB,
locale_code="en",
ad_block=True,
proxy=proxy,
) as sb:
yield sb
sb = None
try:
with SB(
uc=True,
test=True,
headless=USE_HEADLESS,
xvfb=USE_XVFB,
locale_code="en",
ad_block=True,
proxy=proxy,
) as sb:
yield sb
except Exception:
# Log the exception but re-raise it to let FastAPI handle it properly
logger.exception("Exception in SeleniumBase dependency")
raise
def save_screenshot(sb: BaseCase):