-
Notifications
You must be signed in to change notification settings - Fork 10
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
Possible to add a common error superclass for redis-cluster-client errors? Or use with_config
consistently?
#400
Comments
with_config
consistenly?
with_config
consistenly?with_config
consistently?
Hello, It seems that the Although there is a middleware which may be related this issue, I think the above inheritance way is simpler. |
@supercaracal currently I use the By the way, just wondering why the cluster errors in this gem cannot use the |
Yes, it is. Although the Peronally, I don't want to add a dependency between a config and errors just for the error identification. I'd say that error handlings should be done by error types. But I'm not pretty sure of your use case, do you treat multiple clusters or mixed type redis instances? If so, I think there can only be a way to use the
I thought so. So I made the middleware optional since the following pull request. |
@supercaracal yeah it would be nice if |
I understood. Thank you for sharing your use case. I'll work on it ASAP. |
@supercaracal thank you very much for fixing this! It works beautifully 😄 |
Hi team,
I've noticed that all errors in https://github.com/redis-rb/redis-cluster-client/blob/master/lib/redis_client/cluster/errors.rb directly inherit from
::RedisClient::Error
. For some of our error handling, it's useful to be able to distinguish where errors are coming from (for instance, what Redis connection, and whether it's a cluster or not). Normally I'd look at theconfig
that is associated with the redis client error (through https://github.com/redis-rb/redis-client/blob/master/lib/redis_client.rb#L105), but it seems like the choice was made not to usewith_config
to raise errors in this gem. If that is done for good reasons, perhaps you may consider adding aRedisClient::Cluster::Error
superclass that inherits from::RedisClient::Error
, and let all errors in this gem inherit from that instead?The text was updated successfully, but these errors were encountered: