mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-07-05 22:21:31 +08:00
Don't echo full URLs and raw exception text from probe failures.
This commit is contained in:
parent
e0b07014c0
commit
7dba134cda
@ -12,6 +12,7 @@ from __future__ import annotations
|
|||||||
import logging
|
import logging
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
|
|
||||||
@ -86,5 +87,6 @@ async def probe(url: str, *, credential_id: Optional[str] = None) -> ProbeResult
|
|||||||
last_modified=headers.get("Last-Modified"),
|
last_modified=headers.get("Last-Modified"),
|
||||||
)
|
)
|
||||||
except Exception as e: # network / SSRF / timeout
|
except Exception as e: # network / SSRF / timeout
|
||||||
logging.debug("[model_downloader] probe failed for %s: %s", url, e)
|
host = urlparse(url).netloc or "<unknown>"
|
||||||
return ProbeResult(ok=False, status=0, error=f"{type(e).__name__}: {e}")
|
logging.debug("[model_downloader] probe failed for %s: %s", host, type(e).__name__)
|
||||||
|
return ProbeResult(ok=False, status=0, error="probe failed: network error")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user