Short backtrace
- Dominant language
- Rust
- Stars
- 6.7k
- Forks
- 224
- PR merge metrics
- No merged PRs in 30d
Description
I have large codebase which uses `anyhow::{Result, Context, bail}` a lot,
and the errors don't tell much. No filename/line numbers at all.
Using `RUST_BACKTRACE=1` is not convenient.
I found https://github.com/dtolnay/anyhow/issues/22 but it will require many changes to add it everywhere.
Is there an elegant way to get short backtrace when error occur, just like we get it with `unwrap()`?
Example:
```rust
use anyhow::{Result, bail};
fn main() -> Result<()> {
job()
}
fn job() -> Result<()> {
bail!("error in job")
}
```
```console
cargo run
Error: error in job
```
Imagine large codebase with many errors coming from internal libraries... no idea where it happens.
Thanks
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.