Skip to main content

retry_after_ms

Function retry_after_ms 

Source
pub fn retry_after_ms(e: &FetchError) -> Option<u64>
Expand description

Map a FetchError reference to the structured crate::DenialContext channel introduced by ADR-0023 §4.

&FetchError (rather than FetchError) so the orchestrator can produce the structured side-channel without consuming the error it still needs for error.message and the From<FetchError> for ErrorCode collapse above. The Http arm delegates to the From<&HttpError> for Option<DenialContext> impl in crate::http. The server’s own Retry-After for this failure, in milliseconds (#506).

None when the server sent no header, which is most failures. Deliberately NOT backfilled from doiget’s internal backoff: that is a guess about the server, and a guess wearing the name of a server-supplied value is exactly the defect error.disposition and this field exist to remove.

Pairs with crate::Disposition::RetryAfter – the disposition says “retry”, and this says how long the server asked you to wait before you do.