Merge pull request #54064 from kssenii/fix-logical-error

Fix after #52943
This commit is contained in:
robot-ch-test-poll4 2023-08-30 17:06:25 +02:00 committed by GitHub
commit aa3b687d4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,6 +226,8 @@ KeyMetadataPtr CacheMetadata::getKeyMetadata(
if (it == end())
{
if (key_not_found_policy == KeyNotFoundPolicy::THROW)
throw Exception(ErrorCodes::BAD_ARGUMENTS, "No such key `{}` in cache", key);
else if (key_not_found_policy == KeyNotFoundPolicy::THROW_LOGICAL)
throw Exception(ErrorCodes::LOGICAL_ERROR, "No such key `{}` in cache", key);
else if (key_not_found_policy == KeyNotFoundPolicy::RETURN_NULL)
return nullptr;