mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-24 04:57:00 +01:00
Improve error message when socket not found (#412)
This commit is contained in:
parent
72dfe1b035
commit
d4f852837b
|
@ -13,6 +13,7 @@ extern crate log;
|
||||||
|
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use structopt::StructOpt;
|
use structopt::StructOpt;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
// use futures::executor::block_on;
|
// use futures::executor::block_on;
|
||||||
|
|
||||||
|
@ -44,6 +45,10 @@ fn main() {
|
||||||
|
|
||||||
let req = ClientRequest::Status;
|
let req = ClientRequest::Status;
|
||||||
|
|
||||||
|
let spath = PathBuf::from(cfg.sock_path.as_str());
|
||||||
|
if !spath.exists() {
|
||||||
|
error!("kanidm_unixd socket {} does not exist - is the service running?", cfg.sock_path)
|
||||||
|
} else {
|
||||||
match call_daemon_blocking(cfg.sock_path.as_str(), req) {
|
match call_daemon_blocking(cfg.sock_path.as_str(), req) {
|
||||||
Ok(r) => match r {
|
Ok(r) => match r {
|
||||||
ClientResponse::Ok => info!("working!"),
|
ClientResponse::Ok => info!("working!"),
|
||||||
|
@ -55,4 +60,5 @@ fn main() {
|
||||||
error!("Error -> {:?}", e);
|
error!("Error -> {:?}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue