From 4c759b66ad87a1d1c587acd31b240f64d6621633 Mon Sep 17 00:00:00 2001 From: "P. Oscar Boykin" Date: Mon, 2 Jan 2017 11:38:25 -1000 Subject: [PATCH] Make catchNonFatal on Future async --- core/src/main/scala/cats/instances/future.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/scala/cats/instances/future.scala b/core/src/main/scala/cats/instances/future.scala index 112678e96e..79f270d22f 100644 --- a/core/src/main/scala/cats/instances/future.scala +++ b/core/src/main/scala/cats/instances/future.scala @@ -35,6 +35,10 @@ trait FutureInstances extends FutureInstances1 { override def recoverWith[A](fa: Future[A])(pf: PartialFunction[Throwable, Future[A]]): Future[A] = fa.recoverWith(pf) override def map[A, B](fa: Future[A])(f: A => B): Future[B] = fa.map(f) + + override def catchNonFatal[A](a: => A)(implicit ev: Throwable <:< Throwable): Future[A] = Future(a) + + override def catchNonFatalEval[A](a: Eval[A])(implicit ev: Throwable <:< Throwable): Future[A] = Future(a.value) } }