error-handling-debugging
Master error handling across Rust and TypeScript in Tauri applications. Learn custom error types, exception chains, API response patterns, and debugging techniques using tracing and structured logging. Covers database errors, command failures, and React error boundaries.
Error Handling & Debugging Skill provides patterns for managing errors and debugging issues in Tauri applications built with Rust and TypeScript.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-01-30
Error Handling & Debugging Skill provides patterns for managing errors and debugging issues in Tauri applications built with Rust and TypeScript. Master error handling across Rust and TypeScript in Tauri applications. Learn custom error types, exception chains, API response patterns, and debugging techniques using tracing and structured logging. Covers database errors, command failures, and React error boundaries.
Use it when
- error-handling-debugging covers try-catch patterns with async/await, proper error typing to avoid 'unknown' types.
- error-handling-debugging addresses debugging Tauri command failures by enabling structured logging with tracing and instrumentation.
Verify before relying
Read SKILL.md below before installing (2 files). Open directory: indexed for reading, not audited.
Install
cacr92/WeReply/error-handling-debugging · repository language: Python
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do you handle errors in Rust Tauri applications?
error-handling-debugging teaches custom error types using thiserror and anyhow for building exception chains in Tauri. Define Result types wrapping your error enum, use the ? operator for propagation, and serialize errors as JSON responses to the frontend. Tauri's command macro automatically converts Rust errors into TypeScript-compatible responses, letting you handle failures gracefully in React components.
What are TypeScript error handling best practices for async code?
error-handling-debugging covers try-catch patterns with async/await, proper error typing to avoid 'unknown' types, and discriminated unions for structured error responses. Wrap async operations in try blocks, catch specific error conditions, and propagate meaningful context. Use type guards to narrow error types before accessing properties, preventing runtime crashes from unexpected error shapes.
How do you debug Tauri command failures and deserialization errors?
error-handling-debugging addresses debugging Tauri command failures by enabling structured logging with tracing and instrumentation. Check type mismatches in command signatures—Specta attributes must match Rust types exactly. Use console logs on the frontend to inspect serialized responses, enable Tauri's debug mode, and validate JSON payloads. Database errors like 'locked' typically indicate concurrent access; use connection pooling and retry logic with exponential backoff.
How do you set up structured logging and tracing in Rust?
error-handling-debugging demonstrates rust tracing setup using the tracing crate with subscribers for capturing instrumentation events. Initialize a tracing subscriber in your main function, use #[instrument] macros on functions to auto-log entry/exit, and emit span events for diagnostics. Combine with anyhow for error chains that preserve context through the call stack, making failures easier to trace in production logs.
What's the proper way to implement React error boundaries?
error-handling-debugging covers React error boundary implementation using class components with componentDidCatch lifecycle methods. Wrap risky subtrees to catch rendering errors and display fallback UI. Pair with useEffect cleanup patterns to prevent memory leaks from subscriptions, and use dependency arrays correctly to avoid hook warnings. Combine with Tauri command error responses for comprehensive frontend error handling.
How do you implement retry logic with exponential backoff in Rust?
error-handling-debugging teaches retry logic by wrapping async operations in loops with exponential backoff delays. Use tokio::time::sleep to introduce delays between attempts, calculate backoff as base_delay * 2^attempt, and set max retry counts to prevent infinite loops. Combine with custom error types to distinguish retryable errors from permanent failures, enabling graceful degradation when services are temporarily unavailable.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
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!("数据为空,无法继续处理");
}
let processed = self.process_data(&data)
.context("处理数据失败")?;
Ok(processed)
}
ApiResponse Conversion Pattern
```rust use crate::utils::error::{api_err, api_ok, ApiResponse};
[tauri::command]
[specta::specta]
pub async fn handle_formula_request( dto: FormulaDto, state: State<'_, TauriAppState>, ) -> ApiResponse<Formula> { // Using with_service helper for automatic error conversion with_service(state, |ctx| async move {
(truncated - see the full file via the links below)
File tree — 2 files
.claude/skills/error-handling-debugging/SKILL.md
.claude/skills/error-handling-debugging/skill.json
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Implement error handling and recovery in Rust/TypeScript applications”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
api-design guides you through building robust command interfaces for Tauri applications using type-safe data structures and proven patterns. It covers DTO design, validation at API boundaries, error handling strategies, and documentation practices to ensure your backend contracts are clear and maintainable.
Master React 19 and TypeScript 5 component development with production-ready patterns for Ant Design, TanStack Query state management, and Tauri desktop apps. Learn Hooks best practices, form validation, performance optimization with React.memo and useCallback, and type-safe command integration without sacrificing developer experience.
This skill equips you with patterns for Tauri 2.0 desktop development, covering command definition with specta type generation, Rust-React integration, and proper error handling. Learn state management, async best practices, and desktop-specific constraints to avoid common pitfalls like blocking the async runtime or exposing sensitive errors.
Tdd Workflow guides developers through test-first development using the red-green-refactor pattern: write failing tests, implement minimal code to pass, then refactor while maintaining test coverage. It covers unit and integration testing strategies for both Rust and TypeScript, with practical examples including validation logic, mocking external dependencies, and coverage verification tools. All new features and fixes must meet an 80% test coverage threshold.
This skill offers structured refactoring strategies to enhance code quality and maintainability. It covers method extraction, eliminating duplication, reducing complexity, improving naming, and addressing technical debt—all while keeping behavior intact. Learn to apply guard clauses, replace magic numbers with constants, and break down large functions into focused, testable pieces.
Error Handler provides a structured approach to error management across Tauri's Rust backend and React frontend. It covers AppError enum definitions, three-layer error propagation from database through service to command layer, and frontend error handling with try-catch patterns and Ant Design components. The skill includes ErrorBoundary implementation, safe invoke wrappers, and best practices for avoiding panics and unhandled rejections.
More skills deepseek-integration (MIT) · testing-strategy (MIT) · ipc-communication (MIT)