Slightly more information in error message about cached disk (#50897)

This commit is contained in:
Michael Kolupaev 2023-06-13 02:07:05 -07:00 committed by GitHub
parent 9a3cea379f
commit 72f2832129
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<const DiskObjectStorage *>(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();