Skip to content

feat: improve forbidden-uses error message on invalid config - #1381

Merged
woodruffw merged 3 commits into
mainfrom
ww/better-error
Nov 29, 2025
Merged

woodruffw merged 3 commits into
mainfrom
ww/better-error

Conversation

@woodruffw

Copy link
Copy Markdown
Member

Our previous use of untagged meant that we'd swallow our actual underlying error and replace it with a generic "no variants matched" error, which is not super useful to users.

We now employ a minor hack to get JSON style tagged enums to work with serge-yaml, which changed its behavior on 0.9 to default to YAML style explicit tagging (which we do not want).

Signed-off-by: William Woodruff <william@yossarian.net>
@woodruffw woodruffw self-assigned this Nov 29, 2025
@woodruffw woodruffw added enhancement New feature or request config Configuration functionality labels Nov 29, 2025
Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
@woodruffw

Copy link
Copy Markdown
Member Author

This is also probably slightly faster, since we no longer have to perform exhaustive enum matching. But the performance difference doesn't matter at all given that config loading isn't a hot path at all + there are only two variants here.

@woodruffw
woodruffw merged commit d182743 into main Nov 29, 2025
9 checks passed
@woodruffw
woodruffw deleted the ww/better-error branch November 29, 2025 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration functionality enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant