Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

The proposed format is not clear #46

Open
pickfire opened this issue Jul 2, 2021 · 2 comments
Open

The proposed format is not clear #46

pickfire opened this issue Jul 2, 2021 · 2 comments

Comments

@pickfire
Copy link

pickfire commented Jul 2, 2021

thread 'main' panicked at 'config is always valid and exists', src/main.rs:4:33

Error:
    0: invalid config
    1: config file does not exist

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

As a user, I will likely be confused what is 0, 1. Is 0 nearer to exit or nearer to the source of error? Maybe rather than 0 we put source or sink? What about putting the source for each error to be clearer?

thread 'main' panicked at 'config is always valid and exists'

Error:
  src: invalid config, src/main.rs:4:33
    1: config file does not exist, src/main.rs:10:3

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

What about this? What about attaching more context to each path? Like instead of getting Path not found', it will say XXX Path not found`?

@yaahc
Copy link
Member

yaahc commented Jul 2, 2021

The current plan is to copy the output of anyhow, where the first error gets put on the same line, then there's a caused by section which only gets numbered if there are more than 1 source errors. As for the including the path, mara is working on that right now but we probably can't add it to the display impl without duplicating information massively across the ecosystem.

rust-lang/rust#86826

@pickfire
Copy link
Author

pickfire commented Jul 3, 2021

It's okay not to change the first line, but I think the 0, 1 thing is also hard to understand from someone not familiar with rust at first look. At least for me, I cannot differentiate between them easily, it's as bad as not putting in the extra numbers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants