error-handling

Standardize Rust error handling with Result, Option, and the ? operator.

1|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/Zelenov/frename --skill error-handling-zelenov
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/Zelenov/frename/tree/main/.cursor/skills/rust-error-handling
Command: npx skills add https://github.com/Zelenov/frename --skill error-handling-zelenov

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust requires explicit error handling and pattern-based errors; this Skill helps implement Result and Option patterns, and choose between crates like thiserror and anyhow.

Core Features & Use Cases

  • Explicit error handling with Result and Option
  • Ergonomic error propagation using the ? operator
  • Choosing between crates like thiserror and anyhow for custom errors

Quick Start

Define a function that returns Result<T, E> and propagate errors with ?, including a custom error type when needed.

Frequently Asked Questions about error-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle errors in Rust using Result and Option?

Rust error handling with Result and Option requires explicit pattern matching and propagation. This Skill standardizes these patterns, ensuring compile-time safety by guiding the ergonomic use of the ? operator for clear error propagation across library and application codebases.

When should I use thiserror vs anyhow for custom error types in Rust?

Choose thiserror vs anyhow based on your codebase needs: thiserror for libraries requiring specific custom error types, and anyhow for applications needing flexible error handling. This Skill helps standardize the choice and integration of these crates for robust error design.

What is the best way to propagate errors with the ? operator in Rust?

Propagating errors with the ? operator in Rust is best achieved by defining functions that return Result<T, E>. This Skill provides idiomatic patterns for ergonomic error propagation, ensuring errors bubble up cleanly while maintaining type safety and codebase maintainability.

How do I design custom error types for a Rust library?

Designing custom error types for a Rust library involves standardizing error type creation and integration. This Skill covers idiomatic patterns for robust error type design, allowing seamless integration with common crates like thiserror to ensure compile-time safety.

Does Rust error handling with Result work for both libraries and applications?

Rust error handling with Result works effectively for both library and application codebases. This Skill provides tooling guidance and idiomatic patterns to ensure maintainable error handling, applicable whether you are building robust libraries or complex applications.