Merge pull request #57031 from aiven-sal/aiven-sal/fix_namedcoll2

NamedCollections: make exception message more informative.
This commit is contained in:
Kseniia Sumarokova 2023-11-24 16:15:16 +01:00 committed by GitHub
commit c25c6ec403
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,7 +105,7 @@ MutableNamedCollectionPtr tryGetNamedCollectionWithOverrides(
if (allow_override_by_default)
continue;
// if allow_override_by_default is false we don't allow extra arguments
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Override not allowed");
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Override not allowed because setting allow_override_by_default is disabled");
}
else if (!collection_copy->isOverridable(value_override->first, allow_override_by_default))
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Override not allowed for '{}'", value_override->first);