Skip to content

String stream error codes crash normalization #75

@saxon134

Description

@saxon134

error_from_stream_payload() casts error.code to int. Stream error payloads can carry string codes, and the normal HTTP error path already preserves error.code as a string, so a payload like {"error": {"message": "boom", "code": "rate_limit_error"}} raises ValueError instead of the documented GlobalRouterError. Guard the status conversion and normalize the string code separately.

File: src/globalrouter/_errors.py

Line: 69

Severity: high

Summary: invalid int conversion in error_from_stream_payload

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions