initial proxy impl
This commit is contained in:
committed by
Martin Algesten
parent
2956683870
commit
3b0df412ef
15
src/error.rs
15
src/error.rs
@@ -23,6 +23,12 @@ pub enum Error {
|
||||
BadHeader,
|
||||
/// Some unspecified `std::io::Error`. Synthetic error `500`.
|
||||
Io(IoError),
|
||||
/// Proxy information was not properly formatted
|
||||
BadProxy,
|
||||
/// Proxy credentials were not properly formatted
|
||||
BadProxyCreds,
|
||||
/// Proxy could not connect
|
||||
ProxyConnect,
|
||||
}
|
||||
|
||||
impl Error {
|
||||
@@ -47,6 +53,9 @@ impl Error {
|
||||
Error::BadStatus => 500,
|
||||
Error::BadHeader => 500,
|
||||
Error::Io(_) => 500,
|
||||
Error::BadProxy => 500,
|
||||
Error::BadProxyCreds => 500,
|
||||
Error::ProxyConnect => 500,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +71,9 @@ impl Error {
|
||||
Error::BadStatus => "Bad Status",
|
||||
Error::BadHeader => "Bad Header",
|
||||
Error::Io(_) => "Network Error",
|
||||
Error::BadProxy => "Malformed proxy",
|
||||
Error::BadProxyCreds => "Failed to parse proxy credentials",
|
||||
Error::ProxyConnect => "Proxy failed to connect",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +89,9 @@ impl Error {
|
||||
Error::BadStatus => "Bad Status".to_string(),
|
||||
Error::BadHeader => "Bad Header".to_string(),
|
||||
Error::Io(ioe) => format!("Network Error: {}", ioe),
|
||||
Error::BadProxy => "Malformed proxy".to_string(),
|
||||
Error::BadProxyCreds => "Failed to parse proxy credentials".to_string(),
|
||||
Error::ProxyConnect => "Proxy failed to connect".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user