·rust-error-advanced
</>

rust-error-advanced

huiali/rust-skills

深入错误处理专家。处理 Result vs Option, thiserror, anyhow, error context, library vs application errors, 错误处理, Result 用法, 什么时候用 panic

4Installs·0Trend·@huiali

Installation

$npx skills add https://github.com/huiali/rust-skills --skill rust-error-advanced

SKILL.md

| Result | 预期会失败的操作 | 文件读取、网络请求 | | Option | absence 正常 | 查找、可能为空的值 | | panic! | bug 或不变式违规 | 程序逻辑错误、不可恢复错误 | | unreachable!() | 理论上不会执行到的代码 | 匹配穷举 |

| 库代码 | thiserror,精确的错误类型 | | 应用代码 | anyhow,易于传播和添加上下文 | | 库依赖库 | 传递第三方错误(#[from]) | | 需要错误码 | 枚举变体 | | 需要错误链 | context() + withcontext() |

| 处处 unwrap() | 库中 panic | 用 ? | | Box | 丢失类型信息 | thiserror 变体 | | 丢失上下文 | 调试困难 | .context() | | 错误变体过多 | 过度设计 | 简化或合并 |

深入错误处理专家。处理 Result vs Option, thiserror, anyhow, error context, library vs application errors, 错误处理, Result 用法, 什么时候用 panic Source: huiali/rust-skills.

View raw

Facts (cite-ready)

Stable fields and commands for AI/search citations.

Install command
npx skills add https://github.com/huiali/rust-skills --skill rust-error-advanced
Category
</>Dev Tools
Verified
First Seen
2026-02-01
Updated
2026-02-18

Quick answers

What is rust-error-advanced?

深入错误处理专家。处理 Result vs Option, thiserror, anyhow, error context, library vs application errors, 错误处理, Result 用法, 什么时候用 panic Source: huiali/rust-skills.

How do I install rust-error-advanced?

Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/huiali/rust-skills --skill rust-error-advanced Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code or Cursor

Where is the source repository?

https://github.com/huiali/rust-skills