buf icon indicating copy to clipboard operation
buf copied to clipboard

Clearing up error messages in `bufconfig`

Open doriable opened this issue 1 year ago • 0 comments

GitHub Repository

N/A

Commands

$ buf generate

Output

# rm -rf gen && buf generate --template buf.directory.invalid.gen.yaml && tree gen
Failure: decode config file: option branch is not allowed for InputConfigType directory
18:17

# buf generate
Failure: decode buf.gen.yaml: invalid as version v2: could not unmarshal as YAML: yaml: unmarshal errors:
  line 10: field option not found in type bufconfig.externalManagedOverrideConfigV2

Expected Output

This case came up for buf generate, but this a general note on the errors when handling configs -- we are returning the marshal/unmarshal errors, which leak some internal types (e.g. InputConfigType), which may not be helpful to the user. We may want to rework these error messages.

Anything else?

No response

doriable avatar Aug 21 '24 15:08 doriable