From d273a6f14e6a2fa0e213f3e8e5a184fbd70da5ef Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 12 Feb 2026 00:03:33 +0000 Subject: [PATCH] Improve error reporting to show fal.ai response body on failures Instead of raise_for_status() which discards the response body, check resp.ok and include the response text in the error message. This will reveal the actual validation error from fal.ai. https://claude.ai/code/session_01VtRzQMdLschx9awGyTGGH7 --- nodes.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nodes.py b/nodes.py index 8a98d8f..14ed75b 100644 --- a/nodes.py +++ b/nodes.py @@ -52,7 +52,10 @@ def _submit_request(endpoint, payload, timeout, api_key): } resp = requests.post(url, headers=headers, json=payload, timeout=30) - resp.raise_for_status() + if not resp.ok: + raise RuntimeError( + f"fal.ai submit failed ({resp.status_code}): {resp.text}" + ) queue_data = resp.json() request_id = queue_data.get("request_id") @@ -77,7 +80,11 @@ def _submit_request(endpoint, payload, timeout, api_key): if status == "COMPLETED": result_resp = requests.get(result_url, headers=headers, timeout=30) - result_resp.raise_for_status() + if not result_resp.ok: + raise RuntimeError( + f"fal.ai result fetch failed ({result_resp.status_code}): " + f"{result_resp.text}" + ) return result_resp.json() elif status in ("FAILED", "CANCELLED"): raise RuntimeError(