Skip to content

fix(minimax): narrow image error-body except to JSON decode failures - #32

Closed
blackflame007 wants to merge 1 commit into
litellm_internal_stagingfrom
fix_minimax_image_blind_except
Closed

fix(minimax): narrow image error-body except to JSON decode failures#32
blackflame007 wants to merge 1 commit into
litellm_internal_stagingfrom
fix_minimax_image_blind_except

Conversation

@blackflame007

@blackflame007 blackflame007 commented Jul 31, 2026

Copy link
Copy Markdown

The strict-rule gate on #31 failed with BLE001: total 2899 over limit 2898 pointing at MinimaxImageGenerationConfig._error_message_from_body, but #31 was squash-merged before the fix could land on its branch, so the blind except Exception is now on litellm_internal_staging and every subsequent PR inherits the over-budget total. This narrows the catch to the JSON decode failures the helper actually guards against, matching MinimaxVideoConfig._error_message_from_body:

    @staticmethod
    def _error_message_from_body(raw_response: httpx.Response) -> str:
        try:
            body = raw_response.json()
        except (ValueError, JSONDecodeError):
            return raw_response.text
        # ...

httpx.Response.json() raises json.JSONDecodeError (a ValueError subclass) on a non-JSON body, so the HTML-502 path this helper exists for keeps returning raw_response.text and behavior is unchanged.


View with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled.

Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
@blackflame007

Copy link
Copy Markdown
Author

Superseded by #33, which landed the identical narrowing (JSONDecodeError import + except clause) and merged as f0343e6; the strict-rule gate on litellm_internal_staging is green again. Closing to keep the queue clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant