-
Notifications
You must be signed in to change notification settings - Fork 732
bug: Error Message is Partially Helpful #6123
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
https://github.com/apache/opendal/blob/v0.53.1/core/src/raw/http_util/client.rs#L164-L169
let mut req_builder = self
.request(
parts.method,
reqwest::Url::from_str(&uri.to_string()).expect("input request url must be valid"),
)
.headers(parts.headers);The expect message produced here is not ideal.
Here is an example of its presentation.
"input request url must be valid: InvalidIpv4Address"
(see prefix-dev/rattler-build#1595 (comment))
It would be helpful if the message contained the defective url.
Maybe something like the following:
reqwest::Url::from_str(&uri.to_string()).expect(&format!("input request url must be valid {}", uri)),Steps to Reproduce
Provide a defective uri and observe that the defective uri is not presented.
Expected Behavior
I expect to have enough information to identify why the uri is defective.
Additional Context
This problem appeared in rattler-build, which uses this library.
prefix-dev/rattler-build#1595
Are you willing to submit a PR to fix this bug?
- Yes, I would like to submit a PR.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.