mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 20:28:23 +00:00
`json` parses the bare `Infinity`/`NaN` literals into real floats, so the pricing edge rejects them correctly — but pydantic echoes the offending value back in the error's `input` field, and JSONResponse encodes with `allow_nan=False`. Serializing the 422 then raised "Out of range float values are not JSON compliant" and the reply escaped as a 500, reporting a client's bad rate as a server fault. The request already failed closed, so no row was ever written. Handle RequestValidationError explicitly and render non-finite floats as text, which covers every endpoint rather than the pricing edge alone. The integration app now copies the main app's exception handlers so a failing request fails the way it does in production. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011cKHVF5LA7TR5QuYi6ErLM