diff --git a/bindings/matrix-sdk-ffi/src/client.rs b/bindings/matrix-sdk-ffi/src/client.rs index 18bfd4cc8..e822bae7e 100644 --- a/bindings/matrix-sdk-ffi/src/client.rs +++ b/bindings/matrix-sdk-ffi/src/client.rs @@ -1027,10 +1027,18 @@ impl Client { pub async fn resolve_room_alias( &self, room_alias: String, - ) -> Result { + ) -> Result, ClientError> { let room_alias = RoomAliasId::parse(&room_alias)?; let response = self.inner.resolve_room_alias(&room_alias).await?; Ok(response.into()) + match self.inner.resolve_room_alias(&room_alias).await { + Ok(response) => Ok(Some(response.into())), + Err(HttpError::Reqwest(http_error)) => match http_error.status() { + Some(StatusCode::NOT_FOUND) => Ok(None), + _ => Err(http_error.into()), + }, + Err(error) => Err(error.into()), + } } /// Given a room id, get the preview of a room, to interact with it.