coder-rust-error-handling

<skill_overview> Design predictable and ergonomic error handling in Rust

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "coder-rust-error-handling" with this command: npx skills add ozerohax/assistagents/ozerohax-assistagents-coder-rust-error-handling

<skill_overview> Design predictable and ergonomic error handling in Rust

Designing error types Propagating errors with Result Mapping errors at API boundaries Choosing between panic and Result

The Rust Book - Error Handling

</skill_overview> <panic_vs_result> <use_panic_when> Unrecoverable, invariant-breaking failures Bug in the program (logic error) </use_panic_when> <use_result_when> Expected errors (not found, validation) I/O or external dependency failures </use_result_when> </panic_vs_result> <error_types>

Define a dedicated error enum for a module or service Implement Display and Error for custom errors Use From to convert lower-level errors

enum ServiceError { NotFound, InvalidInput, Io(std::io::Error) }

</error_types>

Use ? to propagate errors Add context with map_err or custom variants Preserve original error for debugging

<boundary_mapping>

Map internal errors to public error codes/messages Do not leak sensitive details to clients

</boundary_mapping> <anti_patterns> Avoid unwrap/expect for normal flow Avoid plain String errors without structure Do not panic on validation failures </anti_patterns>

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

coder-csharp-aspnetcore-api

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

coder-csharp-error-handling

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

coder-csharp-efcore-queries

No summary provided by upstream source.

Repository SourceNeeds Review