MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / http_error

Method http_error

crates/core/src/host/instance_env.rs:890–902  ·  view source on GitHub ↗
(err: E)

Source from the content-addressed store, hash-verified

888 }
889
890 fn http_error<E: std::error::Error>(err: E) -> NodesError {
891 // Include the full error chain, not just the top-level message.
892 // `reqwest::Error` wraps underlying causes (DNS failure, connection refused,
893 // timeout, TLS errors, etc.) which are essential for debugging.
894 use std::fmt::Write;
895 let mut message = err.to_string();
896 let mut source = err.source();
897 while let Some(cause) = source {
898 write!(message, ": {cause}").unwrap();
899 source = cause.source();
900 }
901 NodesError::HttpError(message)
902 }
903
904 // Then convert the request into an `http::Request`, a semi-standard "lingua franca" type in the Rust ecosystem,
905 // and map its body into a type `reqwest` will like.

Callers

nothing calls this directly

Calls 4

HttpErrorClass · 0.85
to_stringMethod · 0.45
sourceMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected