Custom Errors Are Non-Negotiable in My Rust Applications (tristonarmstrong.com) 10 points by tristonarmstron 3mo ago ↗ HN
[–] treyd 3mo ago ↗ This is even easier with the thiserror crate: #[derive(Debug, Error) enum AppError { #[error("io: {0}")] Io(#[from] io::Error) } Automatically generates From impls like this and a Display impl that lets you describe the error case with more detail. Very very good ergonomics and completely transparent to downstream libraries.
[–] rezaprima 3mo ago ↗ is that supposed to be https://tristonarmstrong.com/blog/custom-rust-errors ?
3 comments
[ 0.33 ms ] story [ 19.8 ms ] thread