From 65474d9ed470a873902506f4d66233b3f9515387 Mon Sep 17 00:00:00 2001 From: Christopher Davenport Date: Sun, 2 Aug 2020 13:47:01 -0700 Subject: [PATCH] Strings and Integers --- .../main/scala/io/chrisdavenport/rediculous/RedisResult.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/io/chrisdavenport/rediculous/RedisResult.scala b/core/src/main/scala/io/chrisdavenport/rediculous/RedisResult.scala index f4ea573..5f024be 100644 --- a/core/src/main/scala/io/chrisdavenport/rediculous/RedisResult.scala +++ b/core/src/main/scala/io/chrisdavenport/rediculous/RedisResult.scala @@ -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)) } }