Send an error-mapped request, shared by both buffered and streaming paths.
(e: reqwest::Error, url: &str)
| 323 | |
| 324 | /// Send an error-mapped request, shared by both buffered and streaming paths. |
| 325 | fn map_send_error(e: reqwest::Error, url: &str) -> RouterError { |
| 326 | if e.is_timeout() { |
| 327 | RouterError::UpstreamUnavailable(format!("request to {url} timed out")) |
| 328 | } else if e.is_connect() { |
| 329 | RouterError::UpstreamUnavailable(format!("failed to connect to {url}: {e}")) |
| 330 | } else { |
| 331 | RouterError::Internal(format!("HTTP request failed: {e}")) |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | /// Build and send an HTTP request to the backend with a total request timeout. |
| 336 | /// |
no outgoing calls
no test coverage detected