Enum ruma_client_api::error::ErrorBody
source · pub enum ErrorBody {
Standard {
kind: ErrorKind,
message: String,
},
Json(JsonValue),
NotJson {
bytes: Bytes,
deserialization_error: Arc<Error>,
},
}
Available on crate features
client
or server
only.Expand description
The body of a Matrix Client API error.
Variants§
Standard
Fields
A JSON body with the fields expected for Client API errors.
Json(JsonValue)
A JSON body with an unexpected structure.
NotJson
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
A response body that is not valid JSON.
Implementations§
source§impl ErrorBody
impl ErrorBody
sourcepub fn into_error(self, status_code: StatusCode) -> Error
pub fn into_error(self, status_code: StatusCode) -> Error
Convert the ErrorBody into an Error by adding the http status code.