mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 20:47:01 +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 structopt::StructOpt;
|
||||
use std::path::PathBuf;
|
||||
|
||||
// use futures::executor::block_on;
|
||||
|
||||
|
@ -44,15 +45,20 @@ fn main() {
|
|||
|
||||
let req = ClientRequest::Status;
|
||||
|
||||
match call_daemon_blocking(cfg.sock_path.as_str(), req) {
|
||||
Ok(r) => match r {
|
||||
ClientResponse::Ok => info!("working!"),
|
||||
_ => {
|
||||
error!("Error: unexpected response -> {:?}", r);
|
||||
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) {
|
||||
Ok(r) => match r {
|
||||
ClientResponse::Ok => info!("working!"),
|
||||
_ => {
|
||||
error!("Error: unexpected response -> {:?}", r);
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
error!("Error -> {:?}", e);
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
error!("Error -> {:?}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue