Skip to content

fix(filter): show an invalid glob's error once - #763

Merged
wan9chi merged 1 commit into
mainfrom
fix/error-source-repeats
Sep 27, 2026
Merged

wan9chi merged 1 commit into
mainfrom
fix/error-source-repeats

Conversation

@wan9chi

@wan9chi wan9chi commented Sep 27, 2026

Copy link
Copy Markdown
Member

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.

## 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>
@github-actions

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  -0.38%  [-13.52% .. +17.96%]  overhead  +290.48%
dynamic/access             change  +2.06%  [ -6.64% .. +12.46%]  overhead   +16.92%
dynamic/access-relative    change  -0.61%  [ -4.14% ..  +3.16%]  overhead   +63.70%
dynamic/access-contended   change  +2.69%  [ -9.51% ..  +9.80%]  overhead   +45.88%
static/launch              change  -1.26%  [-10.93% .. +12.28%]  overhead  +637.62%
static/access              change  +0.29%  [ -5.60% ..  +3.70%]  overhead +1440.99%
static/access-relative     change  +0.20%  [ -2.36% ..  +2.06%]  overhead +1930.78%
static/access-contended    change  +0.70%  [ -0.80% ..  +2.55%]  overhead +1620.82%

macos

dynamic/launch             change  +0.24%  [ -4.06% ..  +4.53%]  overhead  +220.34%
dynamic/access             change  +0.34%  [-13.19% .. +75.26%]  overhead    +3.67%
dynamic/access-relative    change  -1.36%  [-51.96% ..  +8.02%]  overhead  +264.37%
dynamic/access-contended   change  +3.85%  [-17.39% .. +593.98%]  overhead   +15.84%

windows

dynamic/launch             change  -0.02%  [ -6.55% ..  +9.22%]  overhead   +21.86%
dynamic/access             change  -0.36%  [-10.43% ..  +3.95%]  overhead    +0.37%
dynamic/access-relative    change  +0.00%  [ -1.39% ..  +1.78%]  overhead    +1.44%
dynamic/access-contended   change  +0.35%  [-20.42% .. +38.09%]  overhead    +2.89%

@wan9chi
wan9chi merged commit 08d2bf9 into main Sep 27, 2026
19 checks passed
@wan9chi
wan9chi deleted the fix/error-source-repeats branch September 27, 2026 13:36
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

Successfully merging this pull request may close these issues.

1 participant