@@ -58,12 +58,16 @@ pub enum Error {
5858 HttpsFeatureNotEnabled ,
5959 /// The provided proxy information was not properly formatted. See
6060 /// [Proxy::new](crate::Proxy::new) for the valid format.
61+ #[ cfg( feature = "proxy" ) ]
6162 BadProxy ,
6263 /// The provided credentials were rejected by the proxy server.
64+ #[ cfg( feature = "proxy" ) ]
6365 BadProxyCreds ,
6466 /// The provided proxy credentials were malformed.
67+ #[ cfg( feature = "proxy" ) ]
6568 ProxyConnect ,
6669 /// The provided credentials were rejected by the proxy server.
70+ #[ cfg( feature = "proxy" ) ]
6771 InvalidProxyCreds ,
6872 /// The response body size surpasses
6973 /// [Request::with_max_body_size](crate::request::Request::with_max_body_size).
@@ -105,9 +109,13 @@ impl fmt::Display for Error {
105109 TooManyRedirections => write ! ( f, "too many redirections (over the max)" ) ,
106110 InvalidUtf8InResponse => write ! ( f, "response contained invalid utf-8 where valid utf-8 was expected" ) ,
107111 HttpsFeatureNotEnabled => write ! ( f, "request url contains https:// but the https feature is not enabled" ) ,
112+ #[ cfg( feature = "proxy" ) ]
108113 BadProxy => write ! ( f, "the provided proxy information is malformed" ) ,
114+ #[ cfg( feature = "proxy" ) ]
109115 BadProxyCreds => write ! ( f, "the provided proxy credentials are malformed" ) ,
116+ #[ cfg( feature = "proxy" ) ]
110117 ProxyConnect => write ! ( f, "could not connect to the proxy server" ) ,
118+ #[ cfg( feature = "proxy" ) ]
111119 InvalidProxyCreds => write ! ( f, "the provided proxy credentials are invalid" ) ,
112120 BodyOverflow => write ! ( f, "the response body size surpassed max_body_size" ) ,
113121 // TODO: Uncomment these two for 3.0
0 commit comments