Commit add338d
committed
feat: improve error printing
When using `Result::expect()`, (e.g. in the default `cot::main`)
errors are printed using `Debug` printer. This causes very ugly
errors to be produced. Instead, when the alternate mode is not being
used, just format the error nicely, along with the error source chain.
This roughly duplicates the `anyhow::Error` error printing logic:
https://docs.rs/anyhow/latest/anyhow/struct.Error.html#method.chain1 parent 460b273 commit add338d
1 file changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
175 | 194 | | |
176 | 195 | | |
177 | 196 | | |
| |||
0 commit comments