Skip to content

Improve ApiError Display for typed and oversized response bodies #29

Description

@lightsofapollo

Goal

Make ApiError<E> concise and useful when formatted without losing any data stored on the error.

Scope

Work in src/http_error.rs. Truncate only the displayed body at a named ~500-character limit and append a clear truncation marker. When typed is present, include its debug representation; when typed parsing failed, include parse_error. Keep body, typed, and parse_error unchanged and publicly accessible.

Acceptance criteria

  • Display output stays under a predictable bound for a large response body.
  • Typed error details appear when available.
  • The parse failure reason appears when typed parsing failed.
  • The full raw body remains available through .body.
  • Focused unit tests cover normal, truncated, typed, and parse-error branches.
  • cargo fmt --check, cargo clippy --all-features -- -D warnings, and cargo test --all-features pass.

This is intentionally limited to display formatting; it does not change error classification or generated operation signatures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    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