We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d3c8bb commit 4ac77f2Copy full SHA for 4ac77f2
bases/ecoindex/backend/routers/tasks.py
@@ -70,9 +70,11 @@ async def add_ecoindex_analysis_task(
70
try:
71
r = requests.head(url=web_page.url, timeout=5)
72
r.raise_for_status()
73
- except Exception:
+ except requests.exceptions.RequestException as e:
74
raise HTTPException(
75
- status_code=521,
+ status_code=e.response.status_code
76
+ if e.response
77
+ else status.HTTP_400_BAD_REQUEST,
78
detail=f"The URL {web_page.url} is unreachable. Are you really sure of this url? 🤔",
79
)
80
0 commit comments