Skip to content

Fix error message for XREAD command with wrong parameter#13474

Merged
sundb merged 1 commit intoredis:unstablefrom
sundb:xread_err_meesage
Aug 14, 2024
Merged

Fix error message for XREAD command with wrong parameter#13474
sundb merged 1 commit intoredis:unstablefrom
sundb:xread_err_meesage

Conversation

@sundb
Copy link
Copy Markdown
Collaborator

@sundb sundb commented Aug 14, 2024

Fixed a missing from #13117.
When the number of streams is incorrect, the error message for XREAD needs to include the '+' symbol.

@sundb sundb requested review from LiorKogan and oranagra August 14, 2024 05:04
streams_count = (c->argc-streams_arg);
if ((streams_count % 2) != 0) {
char symbol = xreadgroup ? '>' : '$';
const char *symbol = xreadgroup ? "ID or '>'" : "ID, '+', or '$'";
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i made the ID repeat here because it's easier to maintain and more readable.

Copy link
Copy Markdown
Member

@oranagra oranagra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be an indication that the error message is too specific or verbose. 🤷

@sundb sundb merged commit b94b714 into redis:unstable Aug 14, 2024
@sundb sundb deleted the xread_err_meesage branch August 14, 2024 13:40
funny-dog pushed a commit to funny-dog/redis that referenced this pull request Sep 17, 2025
Fixed a missing from redis#13117.
When the number of streams is incorrect, the error message for `XREAD`
needs to include the '+' symbol.
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.

3 participants