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
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.pyLine: 69
Severity: high
Summary: invalid int conversion in error_from_stream_payload