Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Using Error as a cause loses backtrace. #294

Open
Diggsey opened this issue Jan 10, 2019 · 1 comment
Open

Using Error as a cause loses backtrace. #294

Diggsey opened this issue Jan 10, 2019 · 1 comment

Comments

@Diggsey
Copy link

Diggsey commented Jan 10, 2019

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.

@ecstatic-morse
Copy link

ecstatic-morse commented Sep 10, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants