Files
firezone/rust/anyhow-ext
Thomas Eizinger bcf4ccf817 fix(rust): introduce dedicated downcast functions for anyhow (#10966)
The downcasting abilities of `anyhow` are pretty powerful.
Unfortunately, they can also be a bit tricky to get right. Whilst `is`
and `downcast` work fine for any errors that are within the `anyhow`
error chain, they don't check the chain of errors prior to that. In
other words, if we already have a nested `std::error::Error` with
several causes, `anyhow` cannot downcast to these causes directly.

In order to avoid this footgun, we create a thin-layer on top of the
`anyhow` crate with some downcasting functions that always try to do the
right thing.
2025-11-25 04:14:17 +00:00
..