Add HTTP Upgrade support to Response. (#1376)
This commit is contained in:
		| @@ -185,6 +185,7 @@ impl fmt::Display for Error { | ||||
|             Kind::Body => f.write_str("request or response body error")?, | ||||
|             Kind::Decode => f.write_str("error decoding response body")?, | ||||
|             Kind::Redirect => f.write_str("error following redirect")?, | ||||
|             Kind::Upgrade => f.write_str("error upgrading connection")?, | ||||
|             Kind::Status(ref code) => { | ||||
|                 let prefix = if code.is_client_error() { | ||||
|                     "HTTP status client error" | ||||
| @@ -236,6 +237,7 @@ pub(crate) enum Kind { | ||||
|     Status(StatusCode), | ||||
|     Body, | ||||
|     Decode, | ||||
|     Upgrade, | ||||
| } | ||||
|  | ||||
| // constructors | ||||
| @@ -274,6 +276,10 @@ if_wasm! { | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub(crate) fn upgrade<E: Into<BoxError>>(e: E) -> Error { | ||||
|     Error::new(Kind::Upgrade, Some(e)) | ||||
| } | ||||
|  | ||||
| // io::Error helpers | ||||
|  | ||||
| #[allow(unused)] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user