-
Couldn't load subscription status.
- Fork 1.4k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
package demo
import zio.App
import zio._
import zio.duration._
import zio.console._
object HelloWorld extends App {
def run(args: List[String]) =
for {
f <- interruptWithError.fork
_ <- f.interrupt
_ <- f.join
} yield (ExitCode.success)
val interruptWithError =
ZIO
.sleep(1.seconds)
.onInterrupt(for {
_ <- putStrLn("on interrupt executed")
_ <- ZIO.die(new Throwable("interruption"))
} yield ())
}This code results in the following exit:
on interrupt executed
[error] (run-main-0) zio.FiberFailure: Fiber failed.
[error] An interrupt was produced by #1.
[error] No ZIO Trace available.
[error] zio.FiberFailure: Fiber failed.
[error] An interrupt was produced by #1.
[error] No ZIO Trace available.
The error is completely lost but the finalizer is executed, this behaviour was introduced as a result of RC21 modifications of the FiberContext & ZScope.
The following PR #3883 restores the behaviour as it was pre RC21 including the trace of the errors in finalizers.
adamgfraser
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working