Skip to content

Commit

Permalink
Fix confusing log message, resolves #60
Browse files Browse the repository at this point in the history
  • Loading branch information
johnae committed May 17, 2023
1 parent 1dcb84d commit 4a303f1
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/server/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,19 @@ impl Daemon {

match async_std::fs::remove_file(&self.socket_path).await {
Ok(()) => log::debug!("Removed stale socket {}", &self.socket_path),
Err(e) => log::error!(
"Unable to remove stale socket: {}\n{:?}",
&self.socket_path,
e
),
Err(e) => match e.kind() {
std::io::ErrorKind::NotFound => log::debug!(
"Couldn't remove stale socket {} as the file didn't exist",
&self.socket_path
),
_ => {
log::error!(
"Unable to remove stale socket: {}\n{:?}",
&self.socket_path,
e
)
}
},
};

let listener = UnixListener::bind(&self.socket_path).await?;
Expand Down

0 comments on commit 4a303f1

Please sign in to comment.