diff --git a/dbms/src/Debug/MockRaftStoreProxy.cpp b/dbms/src/Debug/MockRaftStoreProxy.cpp index a3e7f7c564f..c0df7514cee 100644 --- a/dbms/src/Debug/MockRaftStoreProxy.cpp +++ b/dbms/src/Debug/MockRaftStoreProxy.cpp @@ -379,10 +379,7 @@ void MockRaftStoreProxy::bootstrapWithRegion( RUNTIME_CHECK_MSG(regions.empty(), "Mock Proxy regions are not cleared"); auto task_lock = kvs.genTaskLock(); auto lock = kvs.genRegionWriteLock(task_lock); - if (!lock.regions.empty()) - { - throw Exception("KVStore regions are not cleared"); - } + RUNTIME_CHECK_MSG(lock.regions.empty(), "KVStore regions are not cleared"); } auto start = RecordKVFormat::genKey(table_id, 0); auto end = RecordKVFormat::genKey(table_id + 1, 0); @@ -578,10 +575,7 @@ std::tuple MockRaftStorePro std::tuple MockRaftStoreProxy::composeBatchSplit(std::vector && region_ids, std::vector> && ranges, metapb::RegionEpoch old_epoch) { - if (region_ids.size() != ranges.size()) - { - throw Exception("error composeBatchSplit input"); - } + RUNTIME_CHECK_MSG(region_ids.size() == ranges.size(), "error composeBatchSplit input"); auto n = region_ids.size(); raft_cmdpb::AdminRequest request; raft_cmdpb::AdminResponse response;