aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/mod.rs')
-rw-r--r--src/api/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/api/mod.rs b/src/api/mod.rs
index dfefcc8..713f248 100644
--- a/src/api/mod.rs
+++ b/src/api/mod.rs
@@ -199,6 +199,13 @@ impl IntoResponse for ApiError {
/// A store error as an answer, saying why (`StoreError`'s text) where it is the
/// client's; others are logged with `context`, and are a bare `500`.
+/// A read's (`store_status`).
+impl From<StoreError> for ApiError {
+ fn from(error: StoreError) -> Self {
+ store_status(error, "Failed to read store path")
+ }
+}
+
pub(crate) fn store_status(error: StoreError, context: &str) -> ApiError {
let status = match error {
StoreError::Conflict