error-handling-debugging
Installation
SKILL.md
Error Handling & Debugging Skill
Comprehensive error handling and debugging strategies for Tauri + Rust + React applications.
Rust Error Handling
Error Chain with anyhow
use anyhow::{Context, Result, anyhow, bail};
pub async fn complex_operation(&self) -> Result<Output> {
let data = self.fetch_data()
.await
.context("获取数据失败")?;
if data.is_empty() {
bail!("数据为空,无法继续处理");
}