Skip to content

double logging when printing error chains #112

Closed

Description

@nascent-harry

#[error("Network error: {0}")]
Network(#[from] reqwest::Error),

Errors variants which use #[from] should not also use {0} in the display name else you'll double print in the error stack.

https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=a4d6381b454c983ec68e66d5b15a7169

Activity

  1. lightsofapollo commented on Oct 29, 2026

    @lightsofapollo
    Contributor

    on it

  2. added a commit that references this issue on Oct 29, 2026
  3. lightsofapollo commented on Oct 29, 2026

    @lightsofapollo
    Contributor

    Fixed in #113. Generated HttpError::{Network, Middleware} and StreamingError::Json (and this crate's own error types) no longer format their #[from] source into the message; a test now syn-scans all generated error enums to keep it that way. Note: printing with plain {} now shows just e.g. Network error — use source() / a chain reporter for the cause. Will ship in the next release.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions