Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Commit fe9b915

Browse files
authored
improve error reporting (#48)
* add error context to connect function * update connect error message to be more contextual * fix clippy issue * add new line in cargo.toml file
1 parent 4992281 commit fe9b915

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/api.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,12 @@ impl Client {
242242
}
243243

244244
async fn connect(&self) -> Result<UnixStream> {
245-
Ok(UnixStream::connect(&self.socket).await?)
245+
UnixStream::connect(&self.socket).await.with_context(|| {
246+
format!(
247+
"failed to connect to '{:?}'. is zinit listening on that socket?",
248+
self.socket
249+
)
250+
})
246251
}
247252

248253
async fn command(&self, c: &str) -> Result<Value> {

0 commit comments

Comments
 (0)