fix: restore request::Error builder errors as Unsupported #1982
+33
−32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
idk if this was an intentional change in the rate limiting change. the change happened because
enum Statushas special logic for detecting error kinds, but this only happens whenFrom<reqwest::Error>is invoked, and notFrom<ErrorKind>. the logic says that some reqwest errors get treated as different status depending on their type. in particular, the data URI case got an Unsupported status.the rate limiting change did an extra .into() (via
?) which converted a reqwest error into an ErrorKind, and this happened before the into Status conversion.this PR fixes the bug by changing
From<ErrorKind> for Statusto dispatch toFrom<reqwest::Error> for Statusin the BuildRequestClient case. this allows ErrorKind::BuildRequestClient to also be treated as Unsupportedalong the way, i also turn
TryFrom<&Url> for HostKeyintoFrom<&Url> for HostKey, by setting a fallback hostname when the URL has none of its own. this should be conceptually fine, but maybe it will be surprising if it turns up in user-facing output. this could be worked around another way if desired.Fixes #1980