Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(error): wrapped error responses print using debug formatting #991

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.
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.

1 participant