retryOnException

fun retryOnException(maxRetries: Int = -1)

Enables retrying a request if an exception is thrown during the HttpSend phase and specifies the number of retries.