From e872b185ac217bb3a10b4f228ccd4812b1d2d869 Mon Sep 17 00:00:00 2001 From: Brandon Brown Date: Mon, 27 Apr 2026 18:36:17 -0700 Subject: [PATCH] fix: show clean error message when Anthropic API rejects image generation str(anthropic.APIError) dumps the full JSON response body including request_id and error type fields. Use e.message instead to surface only the human-readable text in the 503 error detail. Co-Authored-By: Claude Sonnet 4.6 --- app/images/providers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/images/providers.py b/app/images/providers.py index 1c31479..db99b1f 100644 --- a/app/images/providers.py +++ b/app/images/providers.py @@ -77,7 +77,7 @@ def describe_scene(self, theme_body: str, tag_names: Sequence[str]) -> str: ) except anthropic.APIError as e: logger.error("Claude visualizer API error: %s", e) - raise ImageGenerationError(f"Visualizer error: {e}") from e + raise ImageGenerationError(f"Visualizer error: {e.message}") from e if not response.content: raise ImageGenerationError("Visualizer returned empty response")