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

@@ -106,7 +106,7 @@ fn redirect_host() {
let url = format!("http://localhost:{}/", srv.port);
let result = crate::Agent::new().get(&url).call();
assert!(
matches!(result, Err(ref e) if e.kind() == ErrorKind::DnsFailed),
matches!(result, Err(ref e) if e.kind() == ErrorKind::Dns),
"expected Err(DnsFailed), got: {:?}",
result
);