Skip to content

Commit

Permalink
Strings and Integers
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherDavenport committed Aug 2, 2020
1 parent 95d2fa9 commit 65474d9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ object RedisResult extends RedisResultLowPriority{
implicit val long: RedisResult[Long] = new RedisResult[Long] {
def decode(resp: Resp): Either[Resp,Long] = resp match {
case Resp.Integer(l) => Right(l)
case other => Left(other)
case other => RedisResult[String].decode(other)
.flatMap(s => Either.catchNonFatal(s.toLong).leftMap(_ => resp))
}
}

Expand Down

0 comments on commit 65474d9

Please sign in to comment.