catchAndReturn

Catches exceptions in the flow completion and emits a single item, then completes normally.


fun <T> Flow<T>.catchAndReturn(itemSupplier: suspend (cause: Throwable) -> T): Flow<T>(source)

Catches exceptions in the flow completion and emits a single item provided by itemSupplier, then completes normally.