De-redundantize Error kinds. (#259)

Change "Bad" to "Invalid" in error names, mimicking io::Error::ErrorKind.

Change InvalidProxyCreds to ProxyUnauthorized.

Change DnsFailed to just Dns (the fact that there was a failure is implicit
in the fact that this was an error).
This commit is contained in:
Jacob Hoffman-Andrews
2020-12-05 12:05:29 -08:00
committed by GitHub
parent 57f251d766
commit 6c9378ce37
7 changed files with 27 additions and 30 deletions

View File

@@ -108,7 +108,7 @@ impl Request {
let mut url: Url = match self.url.clone() {
Urlish::Url(u) => u,
Urlish::Str(s) => s.parse().map_err(|e: url::ParseError| {
ErrorKind::BadUrl
ErrorKind::InvalidUrl
.msg(&format!("failed to parse URL '{}'", self.url))
.src(e)
})?,