mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-09 14:19:22 +00:00
Some movement of helper code and refactoring of error handling
This commit is contained in:
+1
-1
@@ -315,7 +315,7 @@ where
|
||||
}
|
||||
Ok(GcRpc::Ok)
|
||||
}
|
||||
_ => Err(Error::Message("Unexpected GC RPC".to_string())),
|
||||
m => Err(Error::unexpected_rpc_message(m)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-5
@@ -514,10 +514,7 @@ where
|
||||
if let SyncRpc::Ok = rpc_resp {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(Error::Message(format!(
|
||||
"Unexpected response to RPC Update: {}",
|
||||
debug_serialize(&rpc_resp)
|
||||
)))
|
||||
Err(Error::unexpected_rpc_message(rpc_resp))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -545,7 +542,7 @@ where
|
||||
self.data.update_many(items)?;
|
||||
Ok(SyncRpc::Ok)
|
||||
}
|
||||
_ => Err(Error::Message("Unexpected sync RPC".to_string())),
|
||||
m => Err(Error::unexpected_rpc_message(m)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -311,7 +311,7 @@ where
|
||||
self.data.update_many(pairs)?;
|
||||
Ok(TableRpc::Ok)
|
||||
}
|
||||
_ => Err(Error::BadRpc("Unexpected table RPC".to_string())),
|
||||
m => Err(Error::unexpected_rpc_message(m)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user