Files
rengine/tools
Yogesh OjhaandClaude Opus 5 8c064904b4 fix(ripestat): an unrecognised resource answered 500 instead of 400
The RIPEstat client handled rate limits and data-level errors but left
resp.raise_for_status() to deal with an HTTP error, so an upstream 400
escaped as a raw httpx.HTTPStatusError past the client's own error
vocabulary and past the service's RIPEStatLookupError wrapper. Asking
for network-info on "-1", or a prefix overview on "notanip", was a 500.

Non-2xx now raises the client's own error, split by who is at fault: a
4xx means RIPEstat refused the resource, which is the caller's input,
and anything else means the upstream failed. The route reads the
chained cause — every service site already raises `from e` — so the
first is a 400 naming what to enter and the second stays 502. That
needed no change to the fourteen service methods.

A GET sweep of 2,686 requests went from eight 5xx endpoints to three,
and those three are honest: RIPEstat itself returns 500 for an AS
number above 2^32, which is a bad gateway and now says so.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K6LcH8uUddjJbKrahf34ys
2026-09-07 07:58:38 +05:30
..