aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgolear <dgolear@yandex-team.com>2023-12-06 19:13:47 +0300
committerdgolear <dgolear@yandex-team.com>2023-12-06 21:10:20 +0300
commit1b3890da1fca8fe35e8eb76182beb914aa8b245f (patch)
tree705de1b6508b99b01622616dd6b20e91da1aa1ac
parent81745ec41b2b6f3d67eff789248c78e9325d59b9 (diff)
downloadydb-1b3890da1fca8fe35e8eb76182beb914aa8b245f.tar.gz
YT: Add no such tablet error code to GetTabletByIndexOrThrow
-rw-r--r--yt/yt/client/tablet_client/table_mount_cache.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/yt/yt/client/tablet_client/table_mount_cache.cpp b/yt/yt/client/tablet_client/table_mount_cache.cpp
index d7958f1ea33..e0726be12b6 100644
--- a/yt/yt/client/tablet_client/table_mount_cache.cpp
+++ b/yt/yt/client/tablet_client/table_mount_cache.cpp
@@ -61,7 +61,8 @@ bool TTableMountInfo::IsChaosReplica() const
TTabletInfoPtr TTableMountInfo::GetTabletByIndexOrThrow(int tabletIndex) const
{
if (tabletIndex < 0 || tabletIndex >= std::ssize(Tablets)) {
- THROW_ERROR_EXCEPTION("Invalid tablet index for table %v: expected in range [0,%v], got %v",
+ THROW_ERROR_EXCEPTION(EErrorCode::NoSuchTablet,
+ "Invalid tablet index for table %v: expected in range [0,%v], got %v",
Path,
Tablets.size() - 1,
tabletIndex);
@@ -113,8 +114,7 @@ int TTableMountInfo::GetRandomMountedTabletIndex() const
ValidateTabletOwner();
if (MountedTablets.empty()) {
- THROW_ERROR_EXCEPTION(
- EErrorCode::TabletNotMounted,
+ THROW_ERROR_EXCEPTION(EErrorCode::TabletNotMounted,
"Table %v has no mounted tablets",
Path);
}
@@ -179,4 +179,3 @@ void TTableMountInfo::ValidateReplicationLog() const
////////////////////////////////////////////////////////////////////////////////
} // namespace NYT::NTabletClient
-