All checks were successful
continuous-integration/drone/push Build is passing
23 lines
537 B
Rust
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,
|
|
}
|
|
}
|
|
} |