News for hackers. Stuff that matters.
Re:Migrating from Go to Rust by malcolmgreaves on Monday May 25, 2026 @11:43AM (#48268169)
> Rust lacks a uniform error type.

Not quite true. The unifying error trait is std::error::Error.

> pain when you have to pass them upward through a chain of calls

Kind of? You just make an enum with the various variants that need to be passed through and use the #[from] macro to generate the conversion code automatically.

It’s more characters than eg. A union type in Python or TypeScript, but it’s not much more.

Plus, it makes you think about your error design, which is important!

There are no comments on this comment yet.