repeatOrElse

suspend fun repeatOrElse(block: suspend () -> Input, orElse: suspend (error: Throwable, output: Output?) -> @UnsafeVariance Output): Output(source)

Repeat the schedule, and uses block as Input for the step function. If the step function throws an exception, it will be caught and passed to orElse.