feat: implement local-files feature with various enhancements and cleanup

This commit is contained in:
2026-03-17 03:00:39 +01:00
parent c4d2e48f73
commit d8dd047020
18 changed files with 160 additions and 131 deletions

View File

@@ -36,6 +36,7 @@ pub enum ApiError {
#[error("auth_required")]
AuthRequired,
#[allow(dead_code)]
#[error("Not found: {0}")]
NotFound(String),
@@ -165,10 +166,12 @@ impl ApiError {
Self::Validation(msg.into())
}
#[cfg(feature = "local-files")]
pub fn internal(msg: impl Into<String>) -> Self {
Self::Internal(msg.into())
}
#[cfg(feature = "local-files")]
pub fn not_found(msg: impl Into<String>) -> Self {
Self::NotFound(msg.into())
}
@@ -178,5 +181,3 @@ impl ApiError {
}
}
/// Result type alias for API handlers
pub type ApiResult<T> = Result<T, ApiError>;