UnwrapThrowExt
should propagate the error for Result<T, E>
#2732
Labels
UnwrapThrowExt
should propagate the error for Result<T, E>
#2732
Describe the Bug
I was debating between creating this issue as a feature request or as a bug, but I do believe it is a bug, as it is not what I would believe to be the intended behavior.
Currently, when calling
unwrap_throw()
orexpect_throw()
on anErr(E)
variant, whereE: Debug
, only the message is printed, and not the debug value ofE
, as it does for the regularexpect()
/unwrap()
counterparts. This makes the thrown error much less usable in diagnostics, especially since theunwrap_throw
does not provide thestd::panic:Location
to hint as to what went wrong and where.If this is, perhaps, a security concern, a feature flag might make this functionality available, and keep the old behavior when this flag is not set. Although, I am behind the idea of mimicking the original functions behavior when it comes to the thrown message.
Steps to Reproduce
Expected Behavior
The
unwrap_throw()
/expect_throw()
trait methods should mimic the behavior of thecore
/std
library, displaying a debug view of the contained error value.Actual Behavior
The
expect_throw()
method only displays the message in the thrown error, and neitherunwrap_throw()
norexpect_throw()
display astd::panic::Location
to trace the origin of the thrown error.The text was updated successfully, but these errors were encountered: