diff --git a/src/error-handling/error-contexts.md b/src/error-handling/error-contexts.md index ae006e9b..bb676d39 100644 --- a/src/error-handling/error-contexts.md +++ b/src/error-handling/error-contexts.md @@ -33,9 +33,10 @@ fn main() {
* `anyhow::Result` is a type alias for `Result`. -* `anyhow::Error` is generic and it can hold any `Error` implementation without changing the type signature. +* `anyhow::Error` is essentially a wrapper around `Box`. As such it's again generally not + a good choice for the public API of a library, but is widely used in applications. * Actual error type inside of it can be extracted for examination if necessary. -* Functionality provided by `anyhow::Result` may be familiar to Go developers, as it provides similar usage patterns and ergonomics - of `(T, error)` from Go. +* Functionality provided by `anyhow::Result` may be familiar to Go developers, as it provides + similar usage patterns and ergonomics to `(T, error)` from Go.