hcl icon indicating copy to clipboard operation
hcl copied to clipboard

Error formatting can result in "<nil>" in output

Open kalafut opened this issue 4 years ago • 0 comments

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?

kalafut avatar Sep 03 '20 18:09 kalafut