Error formatting can result in "<nil>" in output
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.8k
- Forks
- 659
- Avg merge
- 20h 36m
- Merged PRs (30d)
- 6
Description
The conversion of a Diagnostic to an error string assumes a meaningful subject: https://github.com/hashicorp/hcl/blob/90676d47a0ce038f02596e2aa5894bf0c57fad56/diagnostic.go#L77
In practice I'm seeing errors such as <nil>: Configuration file not found; The configuration file foo.hcl does not exist. which are a bit ugly. Should the inclusion of Subject be conditional, or would that cause issues by breaking the current X:Y structure?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in diagnostic.go at the Diagnostic-to-error-string conversion linked in the issue. Inspect how Subject is formatted and check whether existing behavior depends on the current X:Y structure; done means errors without a meaningful Subject no longer contain while the existing formatting remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100