Skip to content

Commit

Permalink
Write which URL was bad in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Oct 10, 2024
1 parent b58c796 commit 4eb7f00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ewebsock/src/native_tungstenite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub(crate) fn ws_receive_impl(url: String, options: Options, on_event: EventHand
pub fn ws_receiver_blocking(url: &str, options: Options, on_event: &EventHandler) -> Result<()> {
let uri: tungstenite::http::Uri = url
.parse()
.map_err(|err| format!("Failed to parse URI: {err}"))?;
.map_err(|err| format!("Failed to parse URL {url:?}: {err}"))?;
let config = tungstenite::protocol::WebSocketConfig::from(options.clone());
let max_redirects = 3; // tungstenite default

Expand Down Expand Up @@ -177,7 +177,7 @@ pub fn ws_connect_blocking(
let max_redirects = 3; // tungstenite default
let uri: tungstenite::http::Uri = url
.parse()
.map_err(|err| format!("Failed to parse URI: {err}"))?;
.map_err(|err| format!("Failed to parse URL {url:?}: {err}"))?;
let (mut socket, response) = match tungstenite::client::connect_with_config(
into_requester(uri, options),
Some(config),
Expand Down

0 comments on commit 4eb7f00

Please sign in to comment.