Skip to content

Commit

Permalink
PR Change: 'ZIO-succeed' -> 'Exit.succeed' for non-effectful completi…
Browse files Browse the repository at this point in the history
…on of onFailure promise.
  • Loading branch information
scottweaver committed Jan 2, 2025
1 parent e080d81 commit 451499d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private[zio] final class WebSocketAppHandler(
callbacks match {
case Some((onComplete, onFailure)) =>
onComplete.unsafe.done(Exit.fail(cause))
onFailure.unsafe.done(ZIO.succeed(cause))
onFailure.unsafe.done(Exit.succeed(cause))
case None => ()
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package zio.http.netty.client

import zio.{Exit, Promise, Unsafe, ZIO}
import zio.{Exit, Promise, Unsafe}

import zio.http.Response
import zio.http.internal.ChannelState
Expand All @@ -19,6 +19,6 @@ private[netty] final class ClientFailureHandler(
val exit = Exit.fail(cause)
onResponse.unsafe.done(exit)
onComplete.unsafe.done(exit)
onFailure.unsafe.done(ZIO.succeed(cause))
onFailure.unsafe.done(Exit.succeed(cause))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ private[netty] final class WebSocketClientInboundHandler(
}

override def exceptionCaught(ctx: ChannelHandlerContext, error: Throwable): Unit = {
implicit val trace = Trace.empty
val exit = Exit.fail(error)
val exit = Exit.fail(error)
onResponse.unsafe.done(exit)
onComplete.unsafe.done(exit)
onFailure.unsafe.done(ZIO.succeed(error))
onFailure.unsafe.done(Exit.succeed(error))
}
}

0 comments on commit 451499d

Please sign in to comment.