Repository navigation
fix(filter): show an invalid glob's error once - #763
Merged
Merged
Conversation
## Motivation Two error variants put their source's message in their own message and also return that source from `source()`. Anything that lists an error's causes shows the message twice. For an invalid glob in `--filter`, the CLI printed: ``` error: Invalid vite task command: vt with args [] under cwd … * invalid --filter expression * Invalid glob pattern: failed to parse glob expression * failed to parse glob expression ``` `PackageFilterParseError::InvalidGlob` and `FromPathError::InvalidPathData` now forward to their source with `#[error(transparent)]`. Wax's own messages, such as `failed to parse glob expression` and `malformed glob expression: …`, already say the problem is a glob. `FromPathError` is converted to another error before it reaches users, so only the `--filter` output changes. A new `filter_invalid_glob` plan snapshot records the chain for an unclosed brace. A `vt_path` unit test checks that `FromPathError::InvalidPathData` has no source of its own. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
fspy benchmarklinuxmacoswindows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Two error variants put their source's message in their own message and also return that source from
source(). Anything that lists an error's causes shows the message twice. For an invalid glob in--filter, the CLI printed:PackageFilterParseError::InvalidGlobandFromPathError::InvalidPathDatanow forward to their source with#[error(transparent)]. Wax's own messages, such asfailed to parse glob expressionandmalformed glob expression: …, already say the problem is a glob.FromPathErroris converted to another error before it reaches users, so only the--filteroutput changes.A new
filter_invalid_globplan snapshot records the chain for an unclosed brace. Avt_pathunit test checks thatFromPathError::InvalidPathDatahas no source of its own.