/claim #9874

Problem

When a Cause contains both a typed failure (Fail) and a defect (Die) or interruption, foldZIO / catchAll uses Cause.failureOrCause and will recover from the typed error, silently dropping the defect/interruption.

Repro from the issue:

val t: Throwable = new RuntimeException("boom")
val dieCause = Cause.die(t)
val combinedCause = dieCause && Cause.fail("boom")
ZIO.failCause(combinedCause).catchAll(_ => ZIO.debug("handled")) *> ZIO.debug("Success")

Fix

Change Cause.failureOrCause (and failureTraceOrCause) to return the non-recoverable part (stripFailures) whenever the Cause contains defects or interruption.

This ensures typed error recovery cannot mask defects/interruption.

Tests

Added regression test:

  • ZIOSpec > catchAll > does not recover from typed errors when the cause contains defects (issue 9874)

Ran locally:

sbt -Dsbt.supershell=false "clean" \
"coreTestsJVM/testOnly zio.ZIOSpec -- -t 9874"

Claim

Total prize pool $300
Total paid $0
Status Pending
Submitted February 08, 2026
Last updated February 08, 2026

Contributors

TH

thecafetron-ctrl

@thecafetron-ctrl

100%

Sponsors

ZI

ZIO

@ZIO

$300