chore: 官网拆分 homepage + 关于页瘦身 + 端口 5175(当前可用状态基线)

This commit is contained in:
Logan.Li committed 2026-10-14 20:31:51 +08:00
1 parent 5eb11826db
commit be151cb68f
85 files changed
+4420 -1530

No files matched your search

+30
View File
@@ -9,3 +9,33 @@ pub mod codes {
pub const KNOWN_HOSTS_PATH: &str = "native.knownHostsPath";
pub const INVALID_HOST_KEY_DECISION: &str = "native.invalidHostKeyDecision";
}
/// Domain failures retain their cause while exposing stable IPC codes where available.
#[derive(Debug, thiserror::Error)]
pub enum AppError {
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
InvalidBase64(#[from] base64::DecodeError),
#[error("{0}")]
TaskJoin(String),
}
impl AppError {
pub fn code(&self) -> Option<&'static str> {
match self {
Self::Io(_) => None,
Self::InvalidBase64(_) => Some(codes::INVALID_BASE64),
Self::TaskJoin(_) => Some(codes::TASK_JOIN),
}
}
}
impl From<AppError> for crate::domain::ssh::OperationResponse {
fn from(error: AppError) -> Self {
match error.code() {
Some(code) => Self::coded(code, error.to_string()),
None => Self::error(error.to_string()),
}
}
}