From 53af79442da52fb7beefcdcc93cc04772df05b9e Mon Sep 17 00:00:00 2001 From: Wojciech Mitros Date: Thu, 16 Mar 2023 12:48:28 +0100 Subject: [PATCH] cql: change exception type when granting incorrect permissions For compatibility with Cassandra, this patch changes the exception type thrown when trying to alter a permission that is not applicable on the given resource from an Invalid query to a Syntax exception. --- cql3/statements/permission_altering_statement.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cql3/statements/permission_altering_statement.cc b/cql3/statements/permission_altering_statement.cc index 87dd3f6d68..a44c20d609 100644 --- a/cql3/statements/permission_altering_statement.cc +++ b/cql3/statements/permission_altering_statement.cc @@ -25,7 +25,7 @@ static auth::permission_set filter_applicable_permissions(const auth::permission auto const filtered_permissions = auth::permission_set::from_mask(ps.mask() & r.applicable_permissions().mask()); if (!filtered_permissions) { - throw exceptions::invalid_request_exception( + throw exceptions::syntax_exception( format("Resource {} does not support any of the requested permissions.", r)); }