Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better TOML parsing error message #1332

Merged
merged 1 commit into from
Jan 4, 2024
Merged

Better TOML parsing error message #1332

merged 1 commit into from
Jan 4, 2024

Conversation

mre
Copy link
Member

@mre mre commented Jan 4, 2024

The error handling for config loading was pretty poor.
That's because we didn't use the correct syntax to show the entire context with anhow.
See "Display representations".

New error message:

error: failed to load config from `invalid.toml`

Caused by:
  could not parse TOML configuration in `invalid.toml`

Caused by:
  TOML parse error at line 1, column 13
    |
  1 | max_age = 42my
    |             ^
  expected newline, `#`

Helps troubleshooting cases like #1306

The error handling for config loading was pretty poor.
That's because we didn't use the correct syntax to show the entire context with `anhow`.
See ["Display representations"](https://docs.rs/anyhow/latest/anyhow/struct.Error.html#display-representations).
@mre mre merged commit d3d0cd5 into master Jan 4, 2024
7 checks passed
@mre mre deleted the feature/toml-error-msg branch January 4, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant