From c6026b3ee343f4d854b6cd96ebc95a5a499f8755 Mon Sep 17 00:00:00 2001 From: Thanh Le Date: Mon, 26 Aug 2024 19:13:02 +0200 Subject: [PATCH] Override onError for IOAsync --- core/shared/src/main/scala/cats/effect/IO.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/shared/src/main/scala/cats/effect/IO.scala b/core/shared/src/main/scala/cats/effect/IO.scala index 4d1f39c86c..ee3a9da1fc 100644 --- a/core/shared/src/main/scala/cats/effect/IO.scala +++ b/core/shared/src/main/scala/cats/effect/IO.scala @@ -1995,6 +1995,9 @@ object IO extends IOCompanionPlatform with IOLowPriorityImplicits with TuplePara override def handleError[A](fa: IO[A])(f: Throwable => A): IO[A] = fa.handleError(f) + override def onError[A](fa: IO[A])(pf: PartialFunction[Throwable, IO[Unit]]): IO[A] = + fa.onError(pf) + override def timeout[A](fa: IO[A], duration: FiniteDuration)( implicit ev: TimeoutException <:< Throwable): IO[A] = { fa.timeout(duration)