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

Add mechanism for generic error formatting to cli/args.zig #5333

Open
mitchellh opened this issue Jan 23, 2025 · 0 comments
Open

Add mechanism for generic error formatting to cli/args.zig #5333

mitchellh opened this issue Jan 23, 2025 · 0 comments

Comments

@mitchellh
Copy link
Contributor

Extracted from #4444

The problem is that the error messages given by configurations are overly vague. The generic cli/args.zig parser only accepts a small error set of InvalidValue, InvalidFormat, etc. And all error messages are derived from that.

I propose introducing a mechanism by which the comptime type T to cli.args.parse can format its own error messages for an explicit error set E. This would all be statically typed and safe so we don't need anyerrors or implicit error sets or any of that madness.

See my comment in #4444 for what I'm thinking.

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

No branches or pull requests

1 participant