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

fix: display reqwest::Error source #3832

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

ericswanson-dfinity
Copy link
Member

Description

Since reqwest 0.12.1 (seanmonstar/reqwest#2199), fmt::Display for reqwest::Error no longer includes the source.

The whole reason for WrappedReqwestError was to avoid displaying the source twice. But since the above change, the source isn't displayed at all.

After this change, dfx will once again display the error source(s) for request::Error, but on separate lines ("Caused by:") like other error sources.

How Has This Been Tested?

Tested locally with dfx extension install with an extension.json with missing fields

Before

Error: error decoding response body

After

Error: error decoding response body
Caused by: missing field `homepage` at line 4 column 4

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

Since reqwest 0.12.1 (seanmonstar/reqwest#2199),
fmt::Display for reqwest::Error no longer includes the source.

The whole reason for WrappedReqwestError was to avoid displaying the source
twice. But since the above change, the source isn't displayed at all.

After this change, dfx will once again display the error source(s) for
request::Error, but on separate lines ("Caused by:") like other error sources.
@ericswanson-dfinity ericswanson-dfinity marked this pull request as ready for review July 15, 2024 17:11
@ericswanson-dfinity ericswanson-dfinity requested a review from a team as a code owner July 15, 2024 17:11
@ericswanson-dfinity ericswanson-dfinity merged commit 1d5677b into master Jul 15, 2024
288 checks passed
@ericswanson-dfinity ericswanson-dfinity deleted the ens/display-reqwest-error-source branch July 15, 2024 18:25
rikonor pushed a commit that referenced this pull request Feb 3, 2025
Since reqwest 0.12.1 (seanmonstar/reqwest#2199),
fmt::Display for reqwest::Error no longer includes the source.

The whole reason for WrappedReqwestError was to avoid displaying the source
twice. But since the above change, the source isn't displayed at all.

After this change, dfx will once again display the error source(s) for
request::Error, but on separate lines ("Caused by:") like other error sources.
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