Charlie Christensen
07/08/2022, 2:27 PMparZip
inside of an either
block.
suspend fun refresh(): Either<Throwable, Unit> = either {
parZip(
{ refreshA().bind() },
{ refreshB().bind() }
) { dataA, dataB ->
persistData(dataA, dataB).bind()
}
}
But if one of the suspending functions doesnt return the proper type, the exception is not caught.
The crash happens with an unsafe cast at line 85 of ParZip.kt
f(a as A, b as B)
Is there any way to catch this exception? I feel like I would need to double wrap the Eithersimon.vergauwen
07/10/2022, 7:00 PMparZip
inside of either { }
.
Could you share a longer or reproducible example so this could be investigated?