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

Gracefully handle invalid URIs #1414

Merged
merged 1 commit into from
Apr 25, 2024
Merged

Gracefully handle invalid URIs #1414

merged 1 commit into from
Apr 25, 2024

Conversation

mre
Copy link
Member

@mre mre commented Apr 25, 2024

With the upgrade to reqwest 0.12, we can finally handle a long-standing issue, when Urls could not be parsed to Uris. Previously, we would panic, but we can now handle that situation gracefully and return an error instead.

I've also renamed Status::is_failure to Status::is_error, because the notion of failures no longer exists in the codebase and we use the term "error" consistently throughout the codebase instead. This is technically a breaking change in the API, but it's fine since we have not released a stable version yet.

More information about the URI parsing issue:

With the upgrade to `reqwest` 0.12, we can finally handle a long-standing
issue, when Urls could not be parsed to Uris. Previously, we would panic, but
we can now handle that situation gracefully and return an error instead.

I've also renamed `Status::is_failure` to `Status::is_error`, because the
notion of failures no longer exists in the codebase and we use the term "error"
consistently throughout the codebase instead. This is technically a breaking
change in the API, but it's fine since we have not released a stable version
yet.

More information about the URI parsing issue:
- #539
- seanmonstar/reqwest#668
@mre mre requested a review from thomas-zahner April 25, 2024 10:25
Copy link
Member

@thomas-zahner thomas-zahner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great definitely much better than panicing

@mre mre merged commit fc85695 into master Apr 25, 2024
7 checks passed
@mre mre deleted the handle-url-parse branch April 25, 2024 13:29
@mre
Copy link
Member Author

mre commented Apr 25, 2024

Thanks for the review. :)

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