matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

send request sould be able with ruma_api::error::Void

Open jamtwister opened this issue 5 years ago • 1 comments

Currently you can only send requests that use error: ruma_client_api::Error (edit: Or ruma_client_api::r0::uiaa::UiaaResponse) in the endpoint declaration. let request = get_server_version::Request::new(); let response = client.send(request).await.unwrap(); |

To Reproduce ` use synapse_admin_api::v1::get_server_version;

let client = Client::new(homeserver_url).unwrap(); let request = get_server_version::Request::new(); let response: get_server_version::Response = client.send(request).await.unwrap(); leads to let response = client.send(request).await.unwrap(); | ^^^^ the trait From<FromHttpResponseError<ruma_api::error::Void>> is not implemented for matrix_sdk::Error `

jamtwister avatar Jan 17 '21 21:01 jamtwister

To make it more obvious for newcomers (since this is labelled a good first issue), the fix is to implement From<FromHttpResponseError<ruma_api::error::Void>> for matrix_sdk::Error.

jplatte avatar Apr 05 '21 13:04 jplatte