etaty / rediscala

Non-blocking, Reactive Redis driver for Scala (with Sentinel support)
Apache License 2.0
790 stars 142 forks source link

Question: How to distinguish between operation failures #213

Open pjazdzewski1990 opened 5 years ago

pjazdzewski1990 commented 5 years ago

Hi, sorry if this is a repost, but I can't find a precise answer in the code nor docs. How do I distinguish between command errors when using rediscala? My use case is that I have code like this

val client: redis.RedisClient = ???
client.get[V](keyStr)
      .map(v => /* something*/)
      .recover {
        //TODO: put more cases here to capture fine-grained errors 
        case NonFatal(t)      => /* something else*/
      }

and I would like to be able to apply different logging/defaults for various cases, for instance: operation timeout. Is the behaviour in case of error (as in: exceptions used to fail the future) documented somewhere? I would appreciate any hints. Thanks a lot