You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We used to (in v1) separately show using thiserror (to remove the tedium of manually writing boilerplate From and Display implementations for custom error enums) and anyhow (to flatten error types and allow adding context to errors). Now we show them together, and it makes it harder to understand the value proposition of thiserror. In particular, the example does not demonstrate the #[from] attribute anymore and loses the ability to dispatch on error enums because it uses the erased anyhow::Result type.
We should split this slide back into two slides again so that we can separately address these separate concerns. thiserror provides convenience without changing semantics, while anyhow changes error semantics in a way that is mostly suitable for applications but not libraries.
The text was updated successfully, but these errors were encountered:
`thiserror` is best understood as a way to eliminate boilerplate on the
patterns we've already seen, and then we can show it in conjunction with
`anyhow` subsequently.
Fixes#2027.
We used to (in v1) separately show using
thiserror
(to remove the tedium of manually writing boilerplateFrom
andDisplay
implementations for custom error enums) andanyhow
(to flatten error types and allow adding context to errors). Now we show them together, and it makes it harder to understand the value proposition ofthiserror
. In particular, the example does not demonstrate the#[from]
attribute anymore and loses the ability to dispatch on error enums because it uses the erasedanyhow::Result
type.We should split this slide back into two slides again so that we can separately address these separate concerns.
thiserror
provides convenience without changing semantics, whileanyhow
changes error semantics in a way that is mostly suitable for applications but not libraries.The text was updated successfully, but these errors were encountered: