Skip to main content

classify_http_sync

Function classify_http_sync 

Source
pub fn classify_http_sync(
    result: Result<Response>,
) -> Result<Response, ControlFlow<Error, Error>>
Expand description

Classify a reqwest::Result<reqwest::blocking::Response> into the ControlFlow shape expected by retry_sync for a typical HTTP call: 5xx + transport errors retry, 4xx fast-fails, 2xx/3xx returns Ok. The returned response (Ok branch) is the caller’s to consume.

This is the convention shared by every HTTP-uploading publisher; see audit A7 dedup S5.