diff --git a/crates/web5/src/credentials/create.rs b/crates/web5/src/credentials/create.rs index 53c0c0d1..221756d5 100644 --- a/crates/web5/src/credentials/create.rs +++ b/crates/web5/src/credentials/create.rs @@ -641,7 +641,7 @@ mod tests { match result { Err(Web5Error::Network(err_msg)) => { assert!( - err_msg.contains("failed to lookup address information"), + err_msg.contains("failed to connect to host"), "Error message is: {}", err_msg ) } diff --git a/crates/web5/src/credentials/verifiable_credential_1_1.rs b/crates/web5/src/credentials/verifiable_credential_1_1.rs index 491cbbe5..bd58ec9a 100644 --- a/crates/web5/src/credentials/verifiable_credential_1_1.rs +++ b/crates/web5/src/credentials/verifiable_credential_1_1.rs @@ -771,7 +771,7 @@ mod tests { match result { Err(Web5Error::Network(err_msg)) => { assert!( - err_msg.contains("failed to lookup address information"), + err_msg.contains("failed to connect to host"), "Error message is: {}", err_msg ) } diff --git a/crates/web5/src/http.rs b/crates/web5/src/http.rs index 87d8567e..4ac631ad 100644 --- a/crates/web5/src/http.rs +++ b/crates/web5/src/http.rs @@ -68,7 +68,9 @@ fn transmit(destination: &Destination, request: &[u8]) -> Result> { // Make the TCP connection to the server let stream = TcpStream::connect((&destination.host[..], destination.port)) - .map_err(|err| Web5Error::Network(err.to_string()))?; + .map_err(|err| Web5Error::Network( + format!("failed to connect to host: {}", err.to_string())) + )?; // Convert the server name to the expected type for TLS validation let server_name = ServerName::try_from(destination.host.clone()) @@ -91,7 +93,9 @@ fn transmit(destination: &Destination, request: &[u8]) -> Result> { } else { // HTTP connection let mut stream = TcpStream::connect((&destination.host[..], destination.port)) - .map_err(|err| Web5Error::Network(err.to_string()))?; + .map_err(|err| Web5Error::Network( + format!("failed to connect to host: {}", err.to_string())) + )?; stream .write_all(request)