Skip to content

Improve error message for minimal headers validation#982

Open
by22Jy wants to merge 1 commit into
kdeldycke:mainfrom
by22Jy:improve-minimal-headers-error-msg
Open

Improve error message for minimal headers validation#982
by22Jy wants to merge 1 commit into
kdeldycke:mainfrom
by22Jy:improve-minimal-headers-error-msg

Conversation

@by22Jy

@by22Jy by22Jy commented Feb 13, 2026

Copy link
Copy Markdown

Summary

  • Improves the error message when the number of headers provided is less than the minimal required
  • Adds a helpful hint to use -m/--minimal-headers option

Context

Fixes #974

Users reported being confused when they got an error saying they need at least 4 headers, without knowing they can adjust this threshold with the --minimal-headers option.

Example:

$ mdedup -h X-Pm-Gluon-Id ...
Error: Invalid value: Provided number of headers to hash (1) is less than the minimal required number of headers (4).

With this change:

$ mdedup -h X-Pm-Gluon-Id ...
Error: Invalid value: Provided number of headers to hash (1) is less than the minimal required number of headers (4). Use -m/--minimal-headers to allow fewer headers.

Changes

- f"the minimal required number of headers ({minimal_headers})."
+ f"the minimal required number of headers ({minimal_headers}). "
+ f"Use -m/--minimal-headers to allow fewer headers."

Testing

The change only affects the error message text, no functional changes.

- Add hint to use -m/--minimal-headers option when validation fails
- Addresses UX issue raised in kdeldycke#974

Users may not be aware they can adjust the minimal headers threshold.
This change makes the error message more helpful by suggesting the solution.
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.

Tool ask me to specify too many headers

1 participant