Open nhaarman opened 6 years ago
Functions like Try<T>.flatMap and Try<T>.fold swallow RuntimeExceptions, making it harder to find bugs.
Try<T>.flatMap
Try<T>.fold
For example, I tried to use a TODO(), but my application did not terminate:
TODO()
fun main(args: Array<String>) { val result = Success("Test").flatMap<Unit> { TODO() } println(result) }
Instead, the console prints
Failure(kotlin.NotImplementedError: An operation is not implemented.)
Functions like
Try<T>.flatMap
andTry<T>.fold
swallow RuntimeExceptions, making it harder to find bugs.For example, I tried to use a
TODO()
, but my application did not terminate:Instead, the console prints