aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorosidorkin <osidorkin@yandex-team.com>2025-01-18 00:46:45 +0300
committerosidorkin <osidorkin@yandex-team.com>2025-01-18 01:01:59 +0300
commitfad0cdd2a82a23ebe041e1643bd2175285f76b37 (patch)
tree14c9205ad726b983e279c0bda5a6157a47694e03
parent52e3bd847f272ae17fe581453ec2c2d33f564453 (diff)
downloadydb-fad0cdd2a82a23ebe041e1643bd2175285f76b37.tar.gz
YT-23953: Correct error message in case of empty tablets list
commit_hash:defdc5f254f617c155bd2a3c50c1a6a15b23c3ee
-rw-r--r--yt/yt/client/tablet_client/table_mount_cache.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/yt/yt/client/tablet_client/table_mount_cache.cpp b/yt/yt/client/tablet_client/table_mount_cache.cpp
index 2232273093..55fa22f660 100644
--- a/yt/yt/client/tablet_client/table_mount_cache.cpp
+++ b/yt/yt/client/tablet_client/table_mount_cache.cpp
@@ -66,6 +66,13 @@ bool TTableMountInfo::IsChaosReplica() const
TTabletInfoPtr TTableMountInfo::GetTabletByIndexOrThrow(int tabletIndex) const
{
if (tabletIndex < 0 || tabletIndex >= std::ssize(Tablets)) {
+ if (Tablets.empty()) {
+ THROW_ERROR_EXCEPTION(NTabletClient::EErrorCode::NoSuchTablet,
+ "Invalid tablet index for table %v: tablets list is empty, got %v",
+ Path,
+ tabletIndex);
+ }
+
THROW_ERROR_EXCEPTION(NTabletClient::EErrorCode::NoSuchTablet,
"Invalid tablet index for table %v: expected in range [0,%v], got %v",
Path,