Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Add backtrace to error output when RUST_BACKTRACE=1 #311

Merged
8 commits merged into from
Sep 6, 2022
Merged

Conversation

ghost
Copy link

@ghost ghost commented Sep 5, 2022

Adds a stack trace to the error output of commands when environment variables RUST_BACKTRACE or RUST_LIB_BACKTRACE are set to 1.

This uses the std::Error::backtrace feature, which is currently unstable, but was stabilized very recently: rust-lang/rust#99573. However this feature is able to be used now by enabling the backtrace feature of the anyhow crate.

This should improve our ability to debug wash errors considerably especially when helping others. Can just ask "hey could you run that again with RUST_BACKTRACE=1 (wash command) and send the output"?

Signed-off-by: Matt Wilkinson [email protected]

Matt Wilkinson added 4 commits September 5, 2022 13:16
Signed-off-by: Matt Wilkinson <[email protected]>
Signed-off-by: Matt Wilkinson <[email protected]>
Signed-off-by: Matt Wilkinson <[email protected]>
@ghost ghost changed the title Add --stack-trace flag using backtrace feature Add backtrace to error output when RUST_BACKTRACE=1 Sep 6, 2022
Matt Wilkinson added 4 commits September 5, 2022 22:56
@ghost ghost marked this pull request as ready for review September 6, 2022 15:06
@ghost ghost merged commit 401df0a into main Sep 6, 2022
@ghost ghost deleted the feat/backtrace branch September 6, 2022 15:07
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant