How to improve your Rust error messages

The anyhow crate is a gem within the Rust ecosystem. Let’s see how it works! The default error messages provided by the Result::Err type are quite spartan. anyhow provides the ability to annotate errors with context messages with its Context trait, which can provide more informative error messages and thus shorten the debugging process. It’s much simpler than wading through messages printed to the console. This short video introduces the crate with a simple example.