Skip to content

Commit

Permalink
Supply the error message when connect fails
Browse files Browse the repository at this point in the history
This might be too ugly
  • Loading branch information
DeCarabas committed Feb 29, 2024
1 parent 0368074 commit 1098403
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/browse/browse_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ use xdg;

pub async fn browse_url_impl(url: &String) -> Result<()> {
let path = socket_path().context("Error getting socket path")?;
let stream = UnixStream::connect(&path).await.context(
"Error connecting to socket (is fwd actually connected here?)",
)?;
let stream = match UnixStream::connect(&path).await {
Ok(s) => s,
Err(e) => bail!(
"Error connecting to socket: {e} (is fwd actually connected here?)"
),
};
let mut writer = MessageWriter::new(stream);
writer
.write(Message::Browse(url.clone()))
Expand Down

0 comments on commit 1098403

Please sign in to comment.