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

`ClientBuildError` and `OpenStoreError` are missing conversion traits into `matrix_sdk::Error`

Open dkasak opened this issue 2 years ago • 4 comments

There's no From<ClientBuildError> and From<OpenStoreError> for matrix_sdk::Error. This makes using e.g. make_store_config and ClientBuilder harder than necessary. Is there a reason for this?

@jplatte mentions a discussion may have happened at some point in the past, but there doesn't appear to be an issue for this so I'm opening one.

dkasak avatar May 19 '22 15:05 dkasak

This was recently discussed in the Matrix room with the conclusion that anyhow probably makes more sense for fn main in simple programs, and I updated the examples accoringly in eeadabc (#696). @dkasak is this resolved from your POV?

jplatte avatar May 24 '22 10:05 jplatte

It does resolve my immediate problem which led to me to discovering this issue, but I think this may be a genuine wart? I think it would be a good idea to define what the meaning of matrix_sdk::Error is supposed to be and then see whether it is acceptable that the SDK is able to produce errors not encompassed by this type.

dkasak avatar May 24 '22 11:05 dkasak

Is this still a concern? I remember there was some chat about this on Matrix, but I'm not certain whether we all agreed in the end.

jplatte avatar Jul 25 '22 13:07 jplatte

Again, the primary concern from my side is: what exactly is matrix_sdk::Error supposed to mean or represent? If we define a meaning, it should be obvious whether ClientBuildError and OpenStoreError should be convertible into it or not.

dkasak avatar Jul 25 '22 13:07 dkasak