You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes when using eyre and printing out the error, the location sections points inside of eyre itself instead of the line at which the error occurred. What is the cause of this, and how do I avoid it?
Example error message:
Error:
0: Could not open file at "/bogus/path"
1: No such file or directory (os error 2)
Location:
/home/ryan/.cargo/registry/src/github.com-1ecc6299db9ec823/eyre-0.6.3/src/context.rs:25
Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Code snippet:
use eyre::{Result,WrapErr};fnmain() -> Result<()>{
color_eyre::install()?;let args = Args::parse();letmut reader:Box<dynRead + Send> = ifletSome(ref path) = args.path{let reader = std::fs::File::open(path).wrap_err(format!("Could not open file at {:?}", path))?;Box::new(reader)}else{// ....};//...}
The text was updated successfully, but these errors were encountered:
@TheButlah this is always a bug, and it just means there's a method that can construct another eyre::Report that I missed and need to add #[track_caller] to. There's nothing you can do to avoid it other than report them to me as you see them, so thank you for giving me the heads up ^_^.
#48 should fix it, I should have a new release with the fixes up on crates in just a few minutes.
Sometimes when using eyre and printing out the error, the location sections points inside of eyre itself instead of the line at which the error occurred. What is the cause of this, and how do I avoid it?
Example error message:
Code snippet:
The text was updated successfully, but these errors were encountered: