mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-05 22:21:31 +00:00
hypha: init will now watch process in background
This commit is contained in:
@ -55,7 +55,7 @@ pub trait XsdInterface {
|
||||
Ok(match self.read_string(path) {
|
||||
Ok(value) => Some(value),
|
||||
Err(error) => {
|
||||
if error.to_string() == "ENOENT" {
|
||||
if error.is_noent_response() {
|
||||
None
|
||||
} else {
|
||||
return Err(error);
|
||||
@ -68,7 +68,7 @@ pub trait XsdInterface {
|
||||
Ok(match self.list(path) {
|
||||
Ok(value) => value,
|
||||
Err(error) => {
|
||||
if error.to_string() == "ENOENT" {
|
||||
if error.is_noent_response() {
|
||||
Vec::new()
|
||||
} else {
|
||||
return Err(error);
|
||||
@ -115,7 +115,7 @@ impl XsdClient {
|
||||
trace!("rm tx={tx} path={path}");
|
||||
let result = self.socket.send_single(tx, XSD_RM, path);
|
||||
if let Err(error) = result {
|
||||
if error.to_string() == "ENOENT" {
|
||||
if error.is_noent_response() {
|
||||
return Ok(true);
|
||||
}
|
||||
return Err(error);
|
||||
|
@ -28,4 +28,13 @@ pub enum Error {
|
||||
InvalidPermissions,
|
||||
}
|
||||
|
||||
impl Error {
|
||||
pub fn is_noent_response(&self) -> bool {
|
||||
match self {
|
||||
Error::ResponseError(message) => message == "ENOENT",
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
Reference in New Issue
Block a user