Skip to main content

send_with_retry_transport_only

Function send_with_retry_transport_only 

Source
pub async fn send_with_retry_transport_only<F, Fut>(
    policy: &RetryPolicy,
    make_request: F,
) -> Result<Response, Error>
where F: Fn() -> Fut, Fut: Future<Output = Result<Response, Error>>,
Expand description

Retry only when no response was received (transport failure), never on an HTTP status. For non-idempotent OAuth token POSTs: an authorization code may already be consumed when a 5xx arrives, so a status-triggered retry would just burn the login; a transport error means the server likely never saw the request, making one more attempt strictly better than failing.