From 72f28321295187ddf40d02a887be3106f6ec4ac3 Mon Sep 17 00:00:00 2001 From: Michael Kolupaev Date: Tue, 13 Jun 2023 02:07:05 -0700 Subject: [PATCH] Slightly more information in error message about cached disk (#50897) --- src/Disks/ObjectStorages/Cached/registerDiskCache.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Disks/ObjectStorages/Cached/registerDiskCache.cpp b/src/Disks/ObjectStorages/Cached/registerDiskCache.cpp index 779ec6120f8..2b40fa9c21b 100644 --- a/src/Disks/ObjectStorages/Cached/registerDiskCache.cpp +++ b/src/Disks/ObjectStorages/Cached/registerDiskCache.cpp @@ -48,7 +48,9 @@ void registerDiskCache(DiskFactory & factory, bool /* global_skip_access_check * auto cache = FileCacheFactory::instance().getOrCreate(name, file_cache_settings); auto disk = disk_it->second; if (!dynamic_cast(disk.get())) - throw Exception(ErrorCodes::BAD_ARGUMENTS, "Cached disk is allowed only on top of object storage"); + throw Exception(ErrorCodes::BAD_ARGUMENTS, + "Cannot wrap disk `{}` with cache layer `{}`: cached disk is allowed only on top of object storage", + disk_name, name); auto disk_object_storage = disk->createDiskObjectStorage();