You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I almost wrote an issue asking for fallible Value types, but then I realized that Value is meant to handle errors, too. It would be clearer to new users to call that type something like CommandResult.
The text was updated successfully, but these errors were encountered:
The idea is that Value represents any valid Redis value, excluding errors. This was inspired by crates like toml and serde_json. When an error message is encountered, deserialization fails and returns the error message as an Error::RedisError(...). It seemed to be the approach which made the most sense from an API point of view, but it's a tradeoff.
As such, I'm not sure if renaming it to that is a good idea, considering returning Result<Value> is clearer than Result<CommandResult>. I can see returning a simple CommandResult, but I'm concerned about the fallout for error handling in general, as it would allow Ok(CommandResult::RedisErr(...)).
Currently, it will return an error if any of the operations fail. It should probably be changed to returning a stream, which would allow the user to pick their preferred behaviour.
I almost wrote an issue asking for fallible
Value
types, but then I realized thatValue
is meant to handle errors, too. It would be clearer to new users to call that type something likeCommandResult
.The text was updated successfully, but these errors were encountered: