Codex Model Missing Values and Parse Failures in Rust
Use `Option`, `Result`, and structured errors so callers can distinguish outcomes and trace an error's source.
中文Install in Codex
Use a local Rust project and Cargo. The exercise can use the standard library and a temporary fixture.
- Copy the pinned `.codex/skills/rust-error-advanced/` directory into `.agents/skills/rust-error-advanced/` in the project.
- Give Codex the library function, its callers, and the failure cases they need to distinguish.
Example task
For local `load_limit`, use three inputs: an absent setting, valid `12`, and invalid `bad`. Define outcomes and an error that preserves the parse cause.What to check
Callers can distinguish absent, valid 12, and parse failure. Tests can match the exact error category.
Original SKILL.md on GitHub · Updated
Frequently asked question
Do I need thiserror in a library?
Follow the project's dependencies. The standard library supports typed errors and sources, while thiserror can reduce display and conversion boilerplate.