-
-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backtrace() should prefer the source's backtrace if it has one #7
Comments
Yeah, source's backtrace should be more relevant. Maybe a good idea would be an explicit |
What if the user launches a thread that might return an error, and they include that error as a source on the main thread? Would that produce two completely separate (but potentially equally important) backtraces? If that is correct, I feel like hiding the outer backtrace may be a bad idea, especially as the inner backtrace would still be accessible through source. |
An explicit |
Currently the generated
backtrace()
method would just returnSome(&self.backtrace)
. Instead it should be returningSome(self.source.backtrace().unwrap_or(&self.backtrace))
. The lower-level error will tend to have a deeper more relevant backtrace.Note: I am not confident about this. Which behavior is the right one?
Separately, we should return source backtraces if self doesn't contain its own backtrace, which we don't currently do.
self.source.backtrace()
in the following case.The text was updated successfully, but these errors were encountered: