core/protocol: subtype ModifyDatabasePrivilegesError validation errors

This commit is contained in:
2025-12-23 12:32:56 +09:00
parent b03338bdf6
commit c75fbebd31

View File

@@ -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()
}