thiserror

Define ergonomic Rust error types with thiserror derive macros.

3|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/yankeeinlondon/rusty-biscuit --skill thiserror
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: thiserror
Source: https://github.com/yankeeinlondon/rusty-biscuit/tree/main/.claude/skills/thiserror
Command: npx skills add https://github.com/yankeeinlondon/rusty-biscuit --skill thiserror

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers create ergonomic, well-typed error types in Rust using the thiserror crate, reducing boilerplate and improving error messaging by deriving Display, From, and Source capabilities.

Core Features & Use Cases

  • Derive-based error implementations with #[derive(Error, Debug)]
  • #[error("...")] formatting for Display messages
  • #[from] conversions to enable the ? operator
  • #[source] for error chaining
  • Use in libraries public APIs to expose precise error variants

Quick Start

Provide a minimal Rust example that defines a custom error type with thiserror using #[derive(Error, Debug)], #[error("...")] for Display, and #[from] conversions.

Frequently Asked Questions about thiserror

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

FAQPage Schema
How do I reduce boilerplate when defining custom error types in Rust?▼

Reduce Rust error type boilerplate by using the thiserror crate to derive Display, From, and Source implementations automatically via #[derive(Error, Debug)] and #[error("...")] attributes.

How do I enable the ? operator for my custom Rust error enum variants?▼

Enable the ? operator for custom Rust error enum variants by applying the #[from] attribute, which automatically generates From implementations for seamless error conversions across variants.

What is the best way to format Display messages for Rust library error variants?▼

Format Display messages for Rust library error variants by using thiserror's #[error("...")] attribute, which accepts inline string interpolation to provide precise, human-readable error descriptions.

How do I chain underlying errors in a Rust custom error type?▼

Chain underlying errors in a Rust custom error type by applying the #[source] attribute to a variant field, establishing error cause semantics without generating automatic From conversions.

Do I need thiserror for application binaries or just library public APIs?▼

thiserror is primarily designed for library crates and public APIs requiring precise error variants with Display, From, and Source semantics, reducing boilerplate in ergonomic error definitions.

What's the difference between #[from] and #[source] attributes in Rust error handling?▼

In Rust error handling, #[from] generates automatic From conversions enabling the ? operator, while #[source] solely establishes error cause chaining without creating the conversion implementation.