0PricingLogin
Learn Rust Coding · Lesson

anyhow

Flexible app errors.

Flexible Application Errors

In application code you often just want errors to bubble up with context, without defining a typed enum for each. The anyhow crate provides one easy error type for exactly that.

Adding anyhow

Add it as a dependency. It pairs well with thiserror: thiserror for libraries, anyhow for binaries.

[dependencies]
anyhow = "1.0"

All lessons in this course

  1. Result and the ? Operator
  2. thiserror
  3. anyhow
  4. Error Conversion
← Back to Learn Rust Coding