Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider removing redis.Nil error from Pipeline.Exec function generated by subcommands? #1860

Closed
LaodaLuo opened this issue Aug 16, 2021 · 2 comments

Comments

@LaodaLuo
Copy link

For example, it has two strings 'a' and 'b' in redis, when I try to get 'a', 'b' and 'c' in pipeline it ocur an redis.Nil error from pipeline.exec function.

Next, I use for range to process every cmder's result and got error only in get 'c' command.

@LaodaLuo
Copy link
Author

what I mean is that error return by Pileline.Exec seems like an error just for pipeline it self, but the error actually generated by subcommands.

So when I wanna use pipeline I should write something like 'if err != nil && err != redis.Nil { return }'

@vmihailenco
Copy link
Collaborator

vmihailenco commented Aug 22, 2021

I am not sure the suggested behavior is better - sometimes you want it this way and sometimes the other way. For example, if your pipeline consists of GET commands, it can be handy to just check for pipe.Err() to be sure that all keys were loaded successfully.

Closing since it is too late to make such change without a very good reason. But thanks for the suggestion.

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

No branches or pull requests

2 participants