aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,