3 ms·
> I'm generally a bit miserable when I try to deal with error handling in Rust, believe it or not. Likewise. I'm a big Rust user, use it for all my personal pr
by indemnity 4y ago
> I'm generally a bit miserable when I try to deal with error handling in Rust, believe it or not.
Likewise. I'm a big Rust user, use it for all my personal projects, but error handling is totally unsolved there.
- Friction around mapping between error types if I need to "add context and rethrow"
- Often lack of stack/trace information for custom error types. Something went wrong the the DB query? Great! Where? Which line of code?
There are solutions for these, I try them, and I'm sure someone will pipe up mentioning them (e.g. anyhow, thiserror, miette, etc), but its just so much damn ceremony to do it properly at a particular call site, especially when you are mixing your own code with library code and each library's unique snowflake error types, that I don't do it consistently.