News for hackers. Stuff that matters.
Re:Rust Cookbook by swsieber on Thursday February 11, 2021 @09:43AM (#26101921)
Disclaimer: takes this with a grain of salt as I do use Box<dyn Error>. But I have a couple of things to note.

1. error chain is not the recommended way, despite being in the book. It needs updating!

2. The error trait in the std has come a long way since the book was originally written

3. You still might want some nicities that that Box<dun Error> doesn't provide you, and so you'd define an enum. You can do it manually, or use a library like anyhow or thiserror depending on if you're an app or library.

4. Rust error handling has been in a lot of flux, but generally improving. It probably does deserve a dedicated section in the book.

I recommend this blog post: https://nick.groenen.me/posts/rust-error-handling/

Re:Rust Cookbook by gsserge on Thursday February 11, 2021 @10:21AM (#26102372)
> I recommend this blog post: https://nick.groenen.me/posts/rust-error-handling/

This blog post is good indeed. The discussion on /r/rust linked at the end of the post is also worth reading.

Another good and light introduction is http://www.sheshbabu.com/posts/rust-error-handling/

And a more in-depth look https://blog.burntsushi.net/rust-error-handling/

Re:Rust Cookbook by michael_j_ward on Thursday February 11, 2021 @10:13AM (#26102260)
Just adding this video [0] that both gives a mental framework for designing errors and a "lay-of-the-land" for current libraries. Jane, the speaker, also heads up Rust's error handling project group [1], and gives her thoughts on future design / work.

[0] https://www.youtube.com/watch?v=rAF8mLI0naQ [1] https://blog.rust-lang.org/inside-rust/2020/09/18/error-hand...