Skip to content
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

Add #[track_caller] to format_err #70

Merged

Conversation

Hoverbear
Copy link
Contributor

eyre isn't reporting error locations correctly right now. (😢 )

Example source:

fn main() -> color_eyre::Result<()> {
    color_eyre::install()?;
    
    Err(eyre::eyre!("Whoops"))
}

Released version:

ana@autonoma:~/git/eyre-demo$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 1.74s
     Running `target/debug/eyre-demo`
Error: 
   0: Whoops

Location:
   /home/ana/.cargo/registry/src/github.com-1ecc6299db9ec823/eyre-0.6.6/src/lib.rs:1164

Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

After this patch it is resolved:

ana@autonoma:~/git/eyre-demo$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/eyre-demo`
Error: 
   0: Whoops

Location:
   src/main.rs:4

Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Signed-off-by: Ana Hobden <operator@hoverbear.org>
@yaahc yaahc merged commit 3eedb84 into eyre-rs:master Feb 25, 2022
@Hoverbear Hoverbear deleted the track-caller-on-format-err branch February 25, 2022 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants