diff options
| author | tv <tv@krebsco.de> | 2026-11-01 22:29:54 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-01 22:29:54 +0100 |
| commit | 3e115a7e9cc5846d6c1025a7297a006c2d64709b (patch) | |
| tree | 56ec60d608884c2b19d9604643a7ec6df54f5c9c /src/api/mod.rs | |
| parent | 1b9239c9144572784dca6d49b92179b2cb57108e (diff) | |
api: add support for counters
Diffstat (limited to 'src/api/mod.rs')
| -rw-r--r-- | src/api/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/api/mod.rs b/src/api/mod.rs index 8ce855e..dfefcc8 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -201,9 +201,10 @@ impl IntoResponse for ApiError { /// client's; others are logged with `context`, and are a bare `500`. pub(crate) fn store_status(error: StoreError, context: &str) -> ApiError { let status = match error { - StoreError::Conflict | StoreError::NotAList | StoreError::PastTheEnd { .. } => { - StatusCode::CONFLICT - } + StoreError::Conflict + | StoreError::NotAList + | StoreError::PastTheEnd { .. } + | StoreError::NotACounter => StatusCode::CONFLICT, StoreError::NotFound | StoreError::UnknownHeads => StatusCode::NOT_FOUND, StoreError::Rejoining => StatusCode::SERVICE_UNAVAILABLE, other => { |
