Tim McNamara, a well-known Rust educator, author of Rust in Action (Manning), and a recipient of a Rust Foundation Fellowship in 2023, speaks with SE Radio host Gavin Henry about error handling in Rust. They discuss the errors that Rust prevents, what an error is in Rust, what Tim classes as the “four levels of error handling,” and the lifecycle of your journey reaching for them. McNamara explains why Rust handles errors as it does, how it differs from other languages, and what the developer experience is like in dealing with Rust errors. He advocates best practices for error handling, what Result<T>
is, the power of Rust Enums, what the question mark operator is, when to unwrap, what Box<dyn std::error::Error>
really means, how to deal with errors across the FFI boundary, and the various Rust error-handling crates that you can use to give you more control. Brought to you by IEEE Computer Society and IEEE Software magazine.
Show Notes
Related Episodes
- SE Radio 562: Bastian Gruber on Rust Web Development
- SE Radio 490: Tim McNamara on Rust 2021 Edition
- SE Radio 280: Gerald Weinberg on Bugs Errors and Software Quality
Other References
- “Understanding and Detecting Real-World Safety Issues in Rust,” IEEE Transactions on Software Engineering
- https://crates.io/crates/thiserror
- https://crates.io/crates/anyhow
- https://crates.io/crates/eyre
- Tim McNamara (@timClicks) on X
- Rust Nation 24 – Rust Nation 24
- Tim McNamara – 4 levels of error handling
- Accelerant
- timClicks — Learn the rust programming language creatively with Tim McNamara – timClicks (Tim McNamara)
- timClicks