Print networke rrors

This commit is contained in:
Nexus 2024-02-23 23:17:55 +00:00
parent fae8edb043
commit 16de655902
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -279,6 +279,7 @@ def preview_url(
f"Failed to fetch {e.response.url} - HTTP {e.response.status_code}: {e.response.text}" f"Failed to fetch {e.response.url} - HTTP {e.response.status_code}: {e.response.text}"
) )
except httpx.NetworkError as e: except httpx.NetworkError as e:
logging.debug(f"Failed to fetch {url}", exc_info=True)
raise HTTPException(502, f"Failed to fetch {url} - {e}") raise HTTPException(502, f"Failed to fetch {url} - {e}")
if "text/html" not in response.headers.get("content-type", ""): if "text/html" not in response.headers.get("content-type", ""):