fix(tauri): replace silent let _ = with structured logging across 20 modules

Replace error-swallowing let _ = patterns with tracing::warn! in browser,
classroom, gateway, intelligence, memory, pipeline, secure_storage, and
viking command handlers. Ensures errors are observable in production logs.
This commit is contained in:
iven
2026-04-03 00:28:39 +08:00
parent 52bdafa633
commit 15d578c5bc
20 changed files with 129 additions and 0 deletions

View File

@@ -52,12 +52,14 @@ pub(crate) struct ProcessLogsResponse {
}
/// Get ZCLAW Kernel status
// @reserved: 暂无前端集成
#[tauri::command]
pub fn zclaw_status(app: AppHandle) -> Result<LocalGatewayStatus, String> {
read_gateway_status(&app)
}
/// Start ZCLAW Kernel
// @reserved: 暂无前端集成
#[tauri::command]
pub fn zclaw_start(app: AppHandle) -> Result<LocalGatewayStatus, String> {
ensure_local_gateway_ready_for_tauri(&app)?;
@@ -67,6 +69,7 @@ pub fn zclaw_start(app: AppHandle) -> Result<LocalGatewayStatus, String> {
}
/// Stop ZCLAW Kernel
// @reserved: 暂无前端集成
#[tauri::command]
pub fn zclaw_stop(app: AppHandle) -> Result<LocalGatewayStatus, String> {
run_zclaw(&app, &["gateway", "stop", "--json"])?;
@@ -75,6 +78,7 @@ pub fn zclaw_stop(app: AppHandle) -> Result<LocalGatewayStatus, String> {
}
/// Restart ZCLAW Kernel
// @reserved: 暂无前端集成
#[tauri::command]
pub fn zclaw_restart(app: AppHandle) -> Result<LocalGatewayStatus, String> {
ensure_local_gateway_ready_for_tauri(&app)?;
@@ -84,18 +88,21 @@ pub fn zclaw_restart(app: AppHandle) -> Result<LocalGatewayStatus, String> {
}
/// Get local auth token from ZCLAW config
// @connected
#[tauri::command]
pub fn zclaw_local_auth() -> Result<LocalGatewayAuth, String> {
read_local_gateway_auth()
}
/// Prepare ZCLAW for Tauri (update allowed origins)
// @connected
#[tauri::command]
pub fn zclaw_prepare_for_tauri(app: AppHandle) -> Result<LocalGatewayPrepareResult, String> {
ensure_local_gateway_ready_for_tauri(&app)
}
/// Approve device pairing request
// @connected
#[tauri::command]
pub fn zclaw_approve_device_pairing(
app: AppHandle,
@@ -107,6 +114,7 @@ pub fn zclaw_approve_device_pairing(
}
/// Run ZCLAW doctor to diagnose issues
// @reserved: 暂无前端集成
#[tauri::command]
pub fn zclaw_doctor(app: AppHandle) -> Result<String, String> {
let result = run_zclaw(&app, &["doctor", "--json"])?;
@@ -114,6 +122,7 @@ pub fn zclaw_doctor(app: AppHandle) -> Result<String, String> {
}
/// List ZCLAW processes
// @connected
#[tauri::command]
pub fn zclaw_process_list(app: AppHandle) -> Result<ProcessListResponse, String> {
let result = run_zclaw(&app, &["process", "list", "--json"])?;
@@ -151,6 +160,7 @@ pub fn zclaw_process_list(app: AppHandle) -> Result<ProcessListResponse, String>
}
/// Get ZCLAW process logs
// @connected
#[tauri::command]
pub fn zclaw_process_logs(
app: AppHandle,
@@ -214,6 +224,7 @@ pub fn zclaw_process_logs(
}
/// Get ZCLAW version information
// @connected
#[tauri::command]
pub fn zclaw_version(app: AppHandle) -> Result<VersionResponse, String> {
let result = run_zclaw(&app, &["--version", "--json"])?;