diff --git a/crates/matrix-sdk/src/authentication/oauth/qrcode/rendezvous_channel.rs b/crates/matrix-sdk/src/authentication/oauth/qrcode/rendezvous_channel.rs index 57fe9981a..66bbd2fee 100644 --- a/crates/matrix-sdk/src/authentication/oauth/qrcode/rendezvous_channel.rs +++ b/crates/matrix-sdk/src/authentication/oauth/qrcode/rendezvous_channel.rs @@ -39,12 +39,14 @@ type Etag = String; fn get_header( header_map: &HeaderMap, header_name: &HeaderName, -) -> Result> { +) -> Result>> { let header = header_map .get(header_name) - .ok_or(HeaderDeserializationError::MissingHeader(ETAG.to_string()))?; + .ok_or(HeaderDeserializationError::MissingHeader(ETAG.to_string())) + .map_err(|error| Box::new(FromHttpResponseError::from(error)))?; - let header = header.to_str()?.to_owned(); + let header = + header.to_str().map_err(|error| Box::new(FromHttpResponseError::from(error)))?.to_owned(); Ok(header) }