Skip to content

Commit

Permalink
better images again
Browse files Browse the repository at this point in the history
  • Loading branch information
yaahc committed Apr 25, 2020
1 parent 0c1b5be commit 3edc5c8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ fn example(&self) -> color_eyre::Result<()> {
}
```

## Short Report Format
## Minimal Report Format

![minimal report format](./pictures/minimal.png)

## Short Report Format (with `RUST_LIB_BACKTRACE=1`)

![short report format](./pictures/short.png)

Expand Down
Binary file modified pictures/full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pictures/minimal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pictures/short.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ pub struct Context {

impl EyreContext for Context {
fn default(error: &(dyn std::error::Error + 'static)) -> Self {
let backtrace = if true { Some(Backtrace::new()) } else { None };
let backtrace = if std::env::var("RUST_LIB_BACKTRACE").is_ok() {
Some(Backtrace::new())
} else {
None
};

let span_trace = if get_deepest_spantrace(error).is_none() {
Some(SpanTrace::capture())
Expand Down Expand Up @@ -131,6 +135,8 @@ impl EyreContext for Context {
"{}",
color_backtrace::print_backtrace(&backtrace, &settings)
)?;
} else if !self.help.is_empty() {
writeln!(f)?;
}

for help in &self.help {
Expand Down

0 comments on commit 3edc5c8

Please sign in to comment.