fix(recipe): treat transient server errors (524/5xx) as non-fatal in image info fetch

Extend _is_transient_server_error() check introduced in 15dfaed4 to
get_image_info(), so Cloudflare 524 and generic 5xx errors during
remote recipe import are logged as info instead of error and do not
produce scary tracebacks.

Same pattern as get_model_versions() - transient upstream failures
return None gracefully rather than being logged as errors.
This commit is contained in:
Will Miao
2026-05-25 08:35:35 +08:00
parent f105500740
commit 397892bb7f

View File

@@ -562,6 +562,13 @@ class CivitaiClient:
if not success:
if is_expected_offline_error(result):
return None
if self._is_transient_server_error(str(result)):
logger.info(
"Transient server error fetching image info for ID %s: %s",
image_id,
result,
)
return None
logger.error(
"Failed to fetch image info for ID %s from civitai.red: %s",
image_id,