继续多语言处理

This commit is contained in:
xintaofei
2026-03-07 15:49:00 +08:00
parent 931f69c421
commit 6e5219cc10
18 changed files with 466 additions and 234 deletions

View File

@@ -8,6 +8,8 @@ use crate::db::error::DbError;
pub enum AppErrorCode {
Unknown,
InvalidInput,
ConfigurationMissing,
ConfigurationInvalid,
NotFound,
AlreadyExists,
PermissionDenied,
@@ -81,3 +83,15 @@ impl From<DbError> for AppCommandError {
Self::db(value)
}
}
impl From<String> for AppCommandError {
fn from(value: String) -> Self {
Self::new(AppErrorCode::Unknown, "Operation failed").with_detail(value)
}
}
impl From<&str> for AppCommandError {
fn from(value: &str) -> Self {
Self::from(value.to_string())
}
}