Rust Error

Error handling expert covering Result, Option, panic strategies, custom error types with thiserror/anyhow, error propagation patterns, and context-rich error chains.

49 stars 7 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add huiali/rust-skills --skill rust-error
Manual install
git clone --depth 1 https://github.com/huiali/rust-skills.git /tmp/rust-skills
mkdir -p ~/.claude/skills
cp -r /tmp/rust-skills/.codex/skills/rust-error ~/.claude/skills/rust-error

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

## Solution Patterns

### Pattern 1: Option for Normal Absence

```rust
// Lookup operations where "not found" is normal
fn find_user(id: u32) -> Option<User> {
    users.get(&id)
}

// Usage patterns
match find_user(123) {
    Some(user) => println!("Found: {}", user.name),
    None => println!("User not found"),
}

// Or convert to Result for propagation
let user = find_user(123).ok_or(UserNotFoundError)?;
```

**When to use**: Queries, lookups, optional configuration values.

**Key insight**: `None` carries no information, just absence.

### Pattern 2: Result for Expected Failures

```rust
// File might not exist (expected failure)
fn read_config(path: &Path) -> Result<String, io::Error> {
    std::fs::read_to_string(path)
}

// Network request might timeout
fn fetch(url: &str) -> Result<Response, reqwest::Error> {
    reqwest::blocking::get(url)
}
```

**When to use**: I/O operations, parsing, validation, network calls.

**Key insight**: Error type carries information about *why* it failed.

### Pattern 3: Custom Error Types (thiserror)
Read the full skill on GitHub

Details

Skill name
rust-error
Path
.codex/skills/rust-error/SKILL.md
License
MIT
Repo updated
9 February 2026

FAQ

What does the Rust Error skill do?

Error handling expert covering Result, Option, panic strategies, custom error types with thiserror/anyhow, error propagation patterns, and context-rich error chains.

How do I install the Rust Error skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add huiali/rust-skills --skill rust-error. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Rust Error popular?

It lives in huiali/rust-skills, which has 49 GitHub stars and 7 forks.

Related skills

Rust Actor

49

huiali/rust-skills

Actor model expert covering message passing, state isolation, supervision trees, deadlock prevention, fault tolerance, Actix framework, and Erlang-style concurrency patterns.

Software Development

Rust Anti Pattern

49

huiali/rust-skills

Rust anti-patterns and common mistakes expert. Handles code review issues with clone abuse, unwrap in production, String misuse, index loops, and refactoring guidance.

Software Development

Rust Async

49

huiali/rust-skills

Advanced async patterns expert. Handles Stream processing, backpressure control, select/join operations, cancellation, Future trait implementation, and async runtime optimization.

Software Development

Rust Error Advanced

49

huiali/rust-skills

深入错误处理专家。处理 Result vs Option, thiserror, anyhow, error context, library vs application errors, 错误处理, Result 用法, 什么时候用 panic--- # 深入错误处理 ## 核心问题 **这个失败是预期的还是 bug?** 错误处理策略决定代码的健壮性。

Software Development

Rust Embedded

49

huiali/rust-skills

嵌入式与 no_std 专家。处理 no_std, embedded-hal, 裸机开发, 中断, DMA, 资源受限环境等问题。触发词:no_std, embedded, embedded-hal, microcontroller, firmware, ISR, DMA, 嵌入式, 裸机--- # 嵌入式与 no_std 开发 ## 核心问题 **如何在资源受限环境或没有标准库的情况下编程?** no_std 不是 Rust 的子集,而是一种不同的编程模式。

Software Development

Rust Ffi

49

huiali/rust-skills

FFI cross-language interop expert covering C/C++ bindings, bindgen, cbindgen, PyO3, JNI, memory layout, data conversion, and safe FFI patterns.

Software Development

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.