-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
In places like
| raise ArgumentError, "NOSCRIPT No matching script. Please use EVAL." |
ArgumentError is being raised. However, the actual redis client will raise things like Redis::CommandError (for the NOSCRIPT error at least). You'll notice that the mock_redis gem takes care to raise the same sorts of errors: https://github.com/brigade/mock_redis/search?q=commanderror&unscoped_q=commanderror
As is, I now have to write my code like
begin
$redis.evalsha(...)
rescue Redis::CommandError, ArgumentError => error # notice the two types of errors here
raise unless error.message.start_with?('NOSCRIPT')
$redis.eval(...)
endUsing only one class or the other, either my test suite will break or my real-world code will. So I think it's prudent to go through each raise and determine whether the right type of error is being used.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels