impl Display for UiaaResponse
This commit is contained in:
parent
5a26c38764
commit
5aef537582
@ -1,6 +1,9 @@
|
||||
//! Module for User-Interactive Authentication API types.
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
use std::{
|
||||
collections::BTreeMap,
|
||||
fmt::{self, Display, Formatter},
|
||||
};
|
||||
|
||||
use ruma_api::{error::ResponseDeserializationError, EndpointError};
|
||||
use serde::{Deserialize, Serialize};
|
||||
@ -74,6 +77,15 @@ pub enum UiaaResponse {
|
||||
MatrixError(MatrixError),
|
||||
}
|
||||
|
||||
impl Display for UiaaResponse {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::AuthResponse(_) => write!(f, "User-Interactive Authentication required."),
|
||||
Self::MatrixError(err) => write!(f, "{}", err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<MatrixError> for UiaaResponse {
|
||||
fn from(error: MatrixError) -> Self {
|
||||
Self::MatrixError(error)
|
||||
|
Loading…
x
Reference in New Issue
Block a user