Gopal S Akshintala
04/10/2020, 12:16 PMIO<Throwable, Int> from which I can get Either<Throwable, Int> in the scenario below. (using attempt() gives me Either<Nothing, Either<Throwable, Int>>)
@Test
fun `BIO with Exception`() {
val bio: IO<Nothing, Int> = IO { if (trueForEver()) throw RuntimeException("error") else 1 }
println(bio.unsafeRunSyncEither())
}
The above code throws exception as expected