Consider using enhanced TOML error messages
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 167
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the problem/challenge you have**
`ytt`'s TOML library now includes a feature to provide more verbose error messages. Let's consider taking advantage of that.
From [the v1.0.0 release notes](https://github.com/BurntSushi/toml/releases/tag/v1.0.0):
> Decode always return a toml.ParseError, which has three methods:
>
> - Error() behaves as before and shows a single concise line with the error.
> - ErrorWithPosition() shows the same error, but also shows the line the error occurred at, similar to e.g. clang or the Rust compiler.
> - ErrorWithUsage() is the same as ErrorWithPosition(), but may also show a longer usage guidance message. This isn't always present (in which case it behaves identical to ErrorWithPosition()), but it should be present for most common mistakes and sources of confusion.
**Describe the solution you'd like**
- [ ] Explore whether we should just adopt the more verbose error handling: how would doing so affect the formatting of our error messages?
- [ ] If that's an improvement, consider whether we should always provide that error handling, or plumb through an (optional) keyword argument to enable that verbosity.
**Anything else you would like to add:**
The upgrade came about through:
- #587
---
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
Contributor guide
Research direction
No source file or test is named. Start by tracing ytt's TOML decoding error path and reviewing the upgrade context in #587 alongside the BurntSushi/toml v1.0.0 release notes. Compare current output with ErrorWithPosition() and ErrorWithUsage(), then establish whether verbosity should be default or optional and document the resulting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100