-
Notifications
You must be signed in to change notification settings - Fork 31
No context in error output? #38
Comments
I assume you are referring to failure's
I'm quite confused. We are using Display, so you should get the string you gave to Line 58 in 789faa7
quicli uses context like this, btw: Line 37 in 789faa7
|
Perhaps they're referring to the fact that only the top-level context gets printed. For example, if you call I ran into this today, though not because I called fn main() {
if let Err(e) = run(Cli::from_args()) {
eprintln!("error: {}", e);
for cause in e.causes().skip(1) {
eprintln!("caused by: {}", cause);
}
}
}
fn run(args: Cli) -> Result<()> {
// main logic
} This gives errors like
instead of just
I suppose it's possible to keep using the Maybe showing the underlying cause would be a better default? I think too much info is better than not enough, in this case. |
Thanks for the great explanation, that makes sense!
Sounds good. Exit with an error should not be the usual case so I'm fine with being a bit more verbose here :) Can you make a PR with that? |
Oh, by the way, I opened #44 about showing backtraces recently, which might be related. |
It would appear that context strings don't appear in the error output when using failure::Error. Noticed this long after I replaced some custom code with quicli. I'm not 100% sure this is why the context error isn't showing, but I'm sure enough that I don't want this to get lost.
The text was updated successfully, but these errors were encountered: