Skip to content

Conversation

@newhoggy
Copy link
Contributor

Changelog

- description: |
    Fixed error message in readStringOfMaxLength to correctly display the actual maximum length parameter instead of hardcoded value "128"
# uncomment types applicable to the change:
  type:
  - bugfix         # fixes a defect

Context

This PR fixes a bug in the error message generation for the readStringOfMaxLength function in the CLI parser. Previously, the error message always displayed "128 characters" as the maximum allowed length, regardless of the actual maxLen parameter value passed to the function. This caused confusion when the function was called with different maximum length constraints.

The fix ensures that the error message accurately reflects the configured maximum length by using the maxLen parameter value in the error message string construction.

How to trust this PR

The change is minimal and focused on a single error message formatting issue. The modification:

  • Replaces the hardcoded string "The provided string must have at most 128 characters, but it has "
  • With a dynamic construction using show maxLen to display the actual maximum length parameter

To verify this fix:

  1. Call any CLI command that uses readStringOfMaxLength with a string exceeding the limit
  2. Observe that the error message now correctly displays the actual maximum length instead of always showing "128"

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Self-reviewed the diff
  • New tests are added if needed and existing tests are updated. See Running tests for more details

@newhoggy newhoggy added this pull request to the merge queue Nov 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 9, 2025
@carbolymer carbolymer added this pull request to the merge queue Nov 12, 2025
Merged via the queue into master with commit e0bf779 Nov 12, 2025
29 checks passed
@carbolymer carbolymer deleted the newhoggy/fix-error-message-for-readStringOfMaxLength branch November 12, 2025 13:05
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.

4 participants