d2a2baebc8
- login works - basic documentation
22 lines
573 B
Rust
22 lines
573 B
Rust
use std::fmt::Display;
|
|
|
|
use serde::Deserialize;
|
|
|
|
#[derive(Debug, Deserialize, thiserror::Error)]
|
|
pub struct AuthError {
|
|
error: String,
|
|
error_description: Option<String>,
|
|
}
|
|
|
|
impl Display for AuthError {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
let error = &self.error;
|
|
|
|
if let Some(ref error_description) = self.error_description {
|
|
writeln!(f, "authentication type '{error}' with message '{error_description:?}'")
|
|
} else {
|
|
writeln!(f, "authentication type '{error}'")
|
|
}
|
|
}
|
|
}
|