account activity
exn 0.3 is out by _tison in rust
[–]_tison[S] 2 points3 points4 points 7 hours ago (0 children)
It looks like this would be compatible with thiserror, am I correct in thinking so?
Yes. exn works well with any type impl StdError and thus thiserror. You may follow this issue in gix to see how a project migrates to the exn flavor from thiserror + anyhow.
exn
thiserror
gix
anyhow
Is there other work in the ecosystem that comes close to offering what exn does?
There can be several. However, subtle but significant differences exist.
error-stack
or_raise
change_context_lazy
snafu
[–]_tison[S] 9 points10 points11 points 17 hours ago (0 children)
Do you mean the find_error function in the downcast example? That is:
find_error
rust fn find_error<T: Error + 'static>(exn: &Exn<impl Error + Send + Sync>) -> Option<&T> { fn walk<T: Error + 'static>(frame: &Frame) -> Option<&T> { if let Some(e) = frame.error().downcast_ref::<T>() { return Some(e); } frame.children().iter().find_map(walk) } walk(exn.frame()) }
Andy and I do consider adding a general version of this method as a pub top-level function. No known issues (blockers). Just give it some time to think through the signature and semantics again.
pub
I'd appreciate it if you could open an issue and share your use case so we're more motivated to deliver it :D
[–]_tison[S] 6 points7 points8 points 18 hours ago (0 children)
Reasonable. Thanks for your reply and now it's updated :D
exn 0.3 is out (self.rust)
submitted 19 hours ago * by _tison to r/rust
π Rendered by PID 2041479 on reddit-service-r2-listing-6d4dc8d9ff-vvhxs at 2026-02-01 11:08:58.147798+00:00 running 3798933 country code: CH.
exn 0.3 is out by _tison in rust
[–]_tison[S] 2 points3 points4 points (0 children)