Raise errors from #pipelined instead of returning them #297
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It seems redis-cluster-client intentionally decides to return errors from #pipelined, rather than raising them. I note that in #37 it was written:
It's certainly true that returning the individual results from pipelined gives strictly more information than raising an exception. UNFORTUNATELY, redis-client chooses the opposite option; if any query caused an error, after processing the entire pipeline it raises rather than returns; see:
https://github.com/redis-rb/redis-client/blob/932c5e8909ede7575d56a117773be39f40e2da88/lib/redis_client/connection_mixin.rb#L60
I think consistency with redis-client is very valuable to have for redis-cluster-client, so I would suggest that changing the behaviour here (perhaps with a major version bump?) might be a good idea?
Alternatively, althought I think this would be even more confusing IMO, we could keep the error handling as-is here but patch it in redis-rb to raise instead of return.