retryOnException

fun retryOnException(maxRetries: Int = -1, retryOnTimeout: Boolean = false)

Enables retrying a request if an exception is thrown during the HttpSend phase and specifies the number of retries. By default, HttpRequestTimeoutException, ConnectTimeoutException and SocketTimeoutException are not retried. Set retryOnTimeout to true to retry on timeout. Note, that in this case, HttpTimeout plugin should be installed after HttpRequestRetry.