MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / map_send_error

Function map_send_error

crates/openshell-router/src/backend.rs:325–333  ·  view source on GitHub ↗

Send an error-mapped request, shared by both buffered and streaming paths.

(e: reqwest::Error, url: &str)

Source from the content-addressed store, hash-verified

323
324/// Send an error-mapped request, shared by both buffered and streaming paths.
325fn 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///

Callers 2

send_backend_requestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected