Skip to content

Instantly share code, notes, and snippets.

View outime's full-sized avatar
🇫🇮

outime

🇫🇮
View GitHub Profile
@outime
outime / FutureToEither.scala
Created January 30, 2017 08:14
How to handle timeout with WS api in Play2.1/Scala 2.10
def asFutureEither[T](f: Future[T]): Future[Either[Throwable, T]] =
f map { Right(_) } recover { case x => Left(x) }