feat: implement local-files feature with various enhancements and cleanup
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user