Skip to content

Conversation

@JosiahBull
Copy link
Contributor

Reasoning

Debug formatting is preferred over Display as it will also print information about wrapped errors, including stack traces, which can make debugging much easier.

Note that this was already the case with UnexpectedResponse variant, this change standardises it across all error variants.

Alternatives

Debug formatting in a Display implementation is a bit of an anti-pattern. The Error type is using the same string formatting implementation for both it's Display and Debug traits. I can split up this functionality so that the Display information can be slightly less verbose if this is desired.

Debug formatting is preferred over Display as it will also print information about wrapped errors, including stack traces, which can make debugging much easier.
@ahl
Copy link
Collaborator

ahl commented Feb 12, 2025

I don't really understand the motivation. In what situation would this be helpful?

@ahl
Copy link
Collaborator

ahl commented Feb 24, 2025

Feel free to re-open if you'd like to proceed with this.

@ahl ahl closed this Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants