failure icon indicating copy to clipboard operation
failure copied to clipboard

Using `Error` as a cause loses backtrace.

Open Diggsey opened this issue 6 years ago • 1 comments

The AsFail implementation for Error only looks for a backtrace on the underlying Fail, and skips backtraces attached directly to the Error. This means that Errors constructed from implementors of the std::error::Error trait lose their backtraces when they are used as a cause.

Diggsey avatar Jan 10 '19 18:01 Diggsey

Confusion around this resulted in rust-lang/crater#455. Ideally, Error would implement Fail, but this is impossible due to coherence issues (#99). Absent that, it would be nice if there was a way to abstract over both Error and Context without throwing away the Backtrace.

ecstatic-morse avatar Sep 10 '19 17:09 ecstatic-morse