diff options
Diffstat (limited to 'src/remake')
| -rw-r--r-- | src/remake/api.rs | 13 | ||||
| -rw-r--r-- | src/remake/quarantine.rs | 2 |
2 files changed, 2 insertions, 13 deletions
diff --git a/src/remake/api.rs b/src/remake/api.rs index 24fb7e8..515468d 100644 --- a/src/remake/api.rs +++ b/src/remake/api.rs @@ -72,6 +72,7 @@ use super::records::{ Retention, Vote, }; use super::{Host, kind, vote}; +use crate::api::error_response; use crate::document::store::StoreError; use crate::force::Force; @@ -281,18 +282,6 @@ enum StartError { Store(#[from] StoreError), } -pub(super) fn error_response( - status: StatusCode, - message: impl Into<String>, - details: Option<JsonValue>, -) -> Response { - let mut body = json!({ "error": message.into() }); - if let (Some(JsonValue::Object(extra)), Some(object)) = (details, body.as_object_mut()) { - object.extend(extra); - } - (status, Json(body)).into_response() -} - fn grace<H: Host>(host: &H) -> u64 { host.dormant_after().as_millis() as u64 } diff --git a/src/remake/quarantine.rs b/src/remake/quarantine.rs index e7ef136..b5166c9 100644 --- a/src/remake/quarantine.rs +++ b/src/remake/quarantine.rs @@ -27,10 +27,10 @@ use tracing::{info, warn}; use uuid::Uuid; use super::Host; -use super::api::error_response; use super::delta; use super::kind::Translator; use super::local::Quarantined; +use crate::api::error_response; use crate::document::replica::Epoch; use crate::document::store; |
