Add support for `dyn Error` references
demurgos opened this issue · 2 comments
demurgos commented
The PR #327 adds support for error references. Unfortunately it's missing support for dyn Error
. Error trait objects are fairly common so it's unfortunate that it's not supported, we should try to add support for it.
Techcable commented
As far as I know, using an owned trait object (Box<dyn Error>
) should work fine with the existing ErrorValue
. The only problem is using a borrowed &dyn Error
with the new ErrorRef
.
Please let me know if this is incorrect.
Techcable commented
Ah, we need to change the bound to E: ?Sized + std::error::Error
(and add a new test for this scenario).