Skip to content

systemone: 4xx/5xx response bodies are discarded (provider detail never reaches the caller) #328

Closed

Description

@ajianaz

Summary

Pre-tag rescan 0.7.1 MAJOR (triaged REAL, LOW). SystemOneTool::new (tole-core/src/systemone.rs ~86-89) builds the agent without http_status_as_error(false) (compare gitea.rs ~88-90, #233). In ureq 3, Error::StatusCode carries only the code, so fetch (~270) maps it to Ok((code, Value::Null)) and execute (~341-345) always reports 'no error body' on non-2xx. The status code survives, so the honest 401/429/529 messages still work; only the provider's detail text (reset hints, reason) is lost. The mock test sends {"error":"slow down"} but only asserts err.contains("rate limited").

Expected

Add .http_status_as_error(false) (the existing Ok path with resp.status() + read_json then handles 4xx/5xx; the Err(StatusCode) arm becomes dead), assert err.contains("slow down"), and fix the stale ureq comment on fetch.

Found by

cora scan (pre-tag 0.7.1 rescan), verified by a read-only triage.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions