use crate::types::error_code::ErrorCode; pub mod api_error; pub mod authentication_error; pub mod registration_error; #[derive(Debug, serde::Serialize)] pub struct ErrorResponse { errcode: ErrorCode, error: String, #[serde(skip_serializing_if = "Option::is_none")] retry_after_ms: Option, } impl ErrorResponse { fn new(errcode: ErrorCode, error: &str, retry_after_ms: Option) -> Self { Self { errcode, error: error.to_owned(), retry_after_ms, } } }