aboutsummaryrefslogtreecommitdiff
path: root/src/table/sync.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-01-03 13:58:05 +0100
committerAlex Auvolat <alex@adnab.me>2022-01-04 12:52:46 +0100
commitbeeef4758e5ec0d521179a799a3237c2c0368911 (patch)
treeeb2734647b3c6e62cef64a5f2b533ac694252c29 /src/table/sync.rs
parentd8ab5bdc3e20759e5ba8a6844393757da3539372 (diff)
downloadgarage-beeef4758e5ec0d521179a799a3237c2c0368911.tar.gz
garage-beeef4758e5ec0d521179a799a3237c2c0368911.zip
Some movement of helper code and refactoring of error handling
Diffstat (limited to 'src/table/sync.rs')
-rw-r--r--src/table/sync.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/table/sync.rs b/src/table/sync.rs
index df9fb4d0..1df2b01d 100644
--- a/src/table/sync.rs
+++ b/src/table/sync.rs
@@ -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)),
}
}
}