Stream: project-error-handling

Topic: Error Chain stabilization


view this post on Zulip Jakub Duchniewicz (Oct 30 2021 at 11:38):

I started to work on issue #58520 where @Harald Hoyer proposed and implemented the chain() method on Error. I looked through the outstanding issues and past ones and it looks to me like the most important one to be solved is this one where an ambiguity is introduced due to two matching implementation of the chain() function. The second one is probably just a change in underlying iterator type to use FusedIterator instead of a regular one.

view this post on Zulip Jakub Duchniewicz (Oct 30 2021 at 11:41):

I wonder if https://github.com/rust-lang/rust/pull/90104 does not solve this issue where we could disable one implementation of this function

view this post on Zulip Jakub Duchniewicz (Oct 30 2021 at 11:42):

The second one seems perfectly sound to be implemented instantly as FusedIterator always returns None when it has been exhausted and that is what we want in case of iterating through a finite chain of errors

view this post on Zulip Jakub Duchniewicz (Oct 30 2021 at 11:45):

apart from these two issues it does not look like there is a lot to tweak in this implementation. We could also wait for Generic Member Access and come up with a totally different way of extracting a chain of errors, for example, with a .context::<Chain>() call


Last updated: Jan 29 2022 at 10:29 UTC