Patrick Michl b0895145de
All checks were successful
continuous-integration/drone/push Build is passing
clean up api error and login stub
2022-04-28 23:15:27 +02:00

23 lines
537 B
Rust

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<u64>,
}
impl ErrorResponse {
fn new(errcode: ErrorCode, error: &str, retry_after_ms: Option<u64>) -> Self {
Self {
errcode,
error: error.to_owned(),
retry_after_ms,
}
}
}