mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2025-03-15 09:50:20 +08:00
first stop, then throw exception
This commit is contained in:
parent
b25cc134a8
commit
ff267c3296
2
main.py
2
main.py
@ -54,10 +54,10 @@ async def read_item(request: LinkRequest):
|
|||||||
challenged = await asyncio.wait_for(bypass_cloudflare(page), timeout=timeout)
|
challenged = await asyncio.wait_for(bypass_cloudflare(page), timeout=timeout)
|
||||||
except asyncio.TimeoutError as e:
|
except asyncio.TimeoutError as e:
|
||||||
logger.info("Timed out bypassing Cloudflare")
|
logger.info("Timed out bypassing Cloudflare")
|
||||||
|
browser.stop()
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
detail="Timed out bypassing Cloudflare", status_code=408
|
detail="Timed out bypassing Cloudflare", status_code=408
|
||||||
) from e
|
) from e
|
||||||
browser.stop()
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
browser.stop()
|
browser.stop()
|
||||||
raise HTTPException(detail="Couldn't bypass", status_code=500) from e
|
raise HTTPException(detail="Couldn't bypass", status_code=500) from e
|
||||||
|
Loading…
x
Reference in New Issue
Block a user