From a50fa70d45f8b5af68d23d60c3bac2af4ecceb58 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sun, 8 Nov 2020 15:04:30 +0100 Subject: Refactor error management in API part --- src/table/table.rs | 2 +- src/table/table_sync.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/table') diff --git a/src/table/table.rs b/src/table/table.rs index 9d43a475..2beac3f4 100644 --- a/src/table/table.rs +++ b/src/table/table.rs @@ -329,7 +329,7 @@ where .await?; Ok(TableRPC::SyncRPC(response)) } - _ => Err(Error::BadRequest(format!("Unexpected table RPC"))), + _ => Err(Error::BadRPC(format!("Unexpected table RPC"))), } } diff --git a/src/table/table_sync.rs b/src/table/table_sync.rs index 145b3068..6c0df15b 100644 --- a/src/table/table_sync.rs +++ b/src/table/table_sync.rs @@ -474,7 +474,7 @@ where todo.push_back(root_ck); } } else { - return Err(Error::BadRequest(format!( + return Err(Error::Message(format!( "Invalid respone to GetRootChecksumRange RPC: {}", debug_serialize(root_cks_resp) ))); @@ -530,7 +530,7 @@ where self.send_items(who, items_to_send).await?; } } else { - return Err(Error::BadRequest(format!( + return Err(Error::Message(format!( "Unexpected response to sync RPC checksums: {}", debug_serialize(&rpc_resp) ))); -- cgit v1.2.3