Ergonomic Errors in Rust: Write Fast, Debug with Ease, Handle Precisely
Posted4 months agoActive4 months ago
gmcgoldr.github.ioTechstory
skepticalmixed
Debate
70/100
Rust ProgrammingError HandlingSoftware Development
Key topics
Rust Programming
Error Handling
Software Development
The article discusses ergonomic error handling in Rust, but the discussion is marred by skepticism about the proposed solution and concerns about the author's potential bias.
Snapshot generated from the HN discussion
Discussion Activity
Active discussionFirst comment
1d
Peak period
12
30-33h
Avg / period
5.4
Comment distribution27 data points
Loading chart...
Based on 27 loaded comments
Key moments
- 01Story posted
Aug 22, 2025 at 12:57 PM EDT
4 months ago
Step 01 - 02First comment
Aug 23, 2025 at 5:58 PM EDT
1d after posting
Step 02 - 03Peak activity
12 comments in 30-33h
Hottest window of the conversation
Step 03 - 04Latest activity
Aug 24, 2025 at 5:53 AM EDT
4 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 44986875Type: storyLast synced: 11/20/2025, 4:35:27 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
Most functional-inspired languages would just have a single `f: T -> Result<U, E>` interface, which supports both (1) a specific error type `E`, which can also be an uninhabited type (e.g. never type) for an infallible operation, and (2) where `U` can be the unit type if the function doesn't return anything on success. That's about as generic as one can get with a single "interface" type.
[1]: https://docs.spring.io/spring-framework/docs/current/javadoc...
I'd rather hand-roll errors than deal with more proc macros. Or better yet, have code gen pay the cost once and never deal with it again.
(compilation time is good for brain switch off time - i.e. reducing cognitive load).
Which is more or less what this XKCD encapsulates.
I have never seen an actual Rist programmer do this, and that was clue #1 that TFA was AI generated without review.
The general advice is good (except for the awkward use of std error), so for anyone who wants to know what rustaceans are actually using:
- std error when it’s required
- anyhow for flexibly dealing with large classes of errors and rethrowing (often in bin crates or internally in a lib crate ), use anyhow::Context to tag errors
- thiserror for building and generating custom errors (in a lib crate)
- miette/eyre for more advanced features
Watch out for exposing error types in public API because then you are bound to push a breaking change if the upstream does.
Anyhow will probably never have a v2 at this point IMO, the entire Rust ecosystem might have to rev!
[EDIT] dont want to suggest that people avoid stackerror, just want to show what other ecosystem projects there are! stackerror seems to fit the hole of anyhow.
Three. Three distinct consumers. Get that in your head. When your application errors out on startup, it's the user who sees the error message. File system errors without seeing the path of the file are useless.