impl Display for UiaaResponse
This commit is contained in:
parent
5a26c38764
commit
5aef537582
@ -1,6 +1,9 @@
|
|||||||
//! Module for User-Interactive Authentication API types.
|
//! 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 ruma_api::{error::ResponseDeserializationError, EndpointError};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@ -74,6 +77,15 @@ pub enum UiaaResponse {
|
|||||||
MatrixError(MatrixError),
|
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 {
|
impl From<MatrixError> for UiaaResponse {
|
||||||
fn from(error: MatrixError) -> Self {
|
fn from(error: MatrixError) -> Self {
|
||||||
Self::MatrixError(error)
|
Self::MatrixError(error)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user