diff options
author | adamw <adam@warski.org> | 2017-11-16 12:22:50 +0100 |
---|---|---|
committer | adamw <adam@warski.org> | 2017-11-16 12:22:50 +0100 |
commit | 837c1a12d9bcf88e3d1055de7e1673a1b92bbe21 (patch) | |
tree | 520bb1e75f420048bc8d270e4fe395afd78f7206 /async-http-client-backend/fs2/src/main | |
parent | 585bfcc741109bef5c534ce245811595062af086 (diff) | |
download | sttp-837c1a12d9bcf88e3d1055de7e1673a1b92bbe21.tar.gz sttp-837c1a12d9bcf88e3d1055de7e1673a1b92bbe21.tar.bz2 sttp-837c1a12d9bcf88e3d1055de7e1673a1b92bbe21.zip |
Add the possibility for monads to recover from errors
Diffstat (limited to 'async-http-client-backend/fs2/src/main')
-rw-r--r-- | async-http-client-backend/fs2/src/main/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/async-http-client-backend/fs2/src/main/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala b/async-http-client-backend/fs2/src/main/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala index 4dfc1da..8343a9b 100644 --- a/async-http-client-backend/fs2/src/main/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala +++ b/async-http-client-backend/fs2/src/main/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala @@ -108,4 +108,8 @@ private[fs2] class EffectMonad[F[_]](implicit F: Effect[F]) F.flatMap(fa)(f) override def error[T](t: Throwable): F[T] = F.raiseError(t) + + override protected def handleWrappedError[T](rt: F[T])( + h: PartialFunction[Throwable, F[T]]): F[T] = + F.recoverWith(rt)(h) } |