Open yoshuawuyts opened 3 years ago
I'd be willing to attempt to implement this and submit a PR. Are you suggesting using something like the thiserror
crate, or a custom error type with a custom std::error::Error
impl?
that's a good question; I think this should wrap the url::Url
's error with the Status
trait and send back a 500 status code. We don't need a custom impl or other crate since http-types
already has its own Error
type.
Now that
TryFrom<str> for Url
has been implemented, using theUrl
struct is a lot more pleasant. This opens up the possibility again for us to move from a "panic if parsing fails" to returning errors if parsing fails.