From c75fbebd31b3332cd88fe7e938354d7cfbccb2e9 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 23 Dec 2025 12:32:56 +0900 Subject: [PATCH] core/protocol: subtype `ModifyDatabasePrivilegesError` validation errors --- src/core/protocol/commands/modify_privileges.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/protocol/commands/modify_privileges.rs b/src/core/protocol/commands/modify_privileges.rs index a2afe71..df9ba81 100644 --- a/src/core/protocol/commands/modify_privileges.rs +++ b/src/core/protocol/commands/modify_privileges.rs @@ -96,9 +96,10 @@ impl ModifyDatabasePrivilegesError { #[allow(dead_code)] pub fn error_type(&self) -> String { match self { - // TODO: should these be subtyped? - ModifyDatabasePrivilegesError::DatabaseValidationError(err) => err.error_type(), - ModifyDatabasePrivilegesError::UserValidationError(err) => err.error_type(), + ModifyDatabasePrivilegesError::DatabaseValidationError(err) => { + err.error_type() + "/database" + } + ModifyDatabasePrivilegesError::UserValidationError(err) => err.error_type() + "/user", ModifyDatabasePrivilegesError::DatabaseDoesNotExist => { "database-does-not-exist".to_string() }