[core] Improve error message of NormalMember.modifyAdmin(); #2370

This commit is contained in:
Karlatemp 2022-12-03 19:30:15 +08:00
parent 943be41108
commit b5fcbe99fb
No known key found for this signature in database
GPG Key ID: BA173CA2B9956C59

View File

@ -213,7 +213,17 @@ internal class NormalMemberImpl constructor(
) as TroopManagement.ModifyAdmin.Response
check(resp.success) {
"Failed to modify admin, cause: ${resp.msg}"
buildString {
append("Failed to ")
append(if (operation) "grant" else "revoke")
append(" administrator privileges ")
append(if (operation) "to" else "from")
append(" member ")
append(id).append(" in group ").append(group.id)
append(": code=").append(resp.code)
append(", msg=").append(resp.msg)
}
}
this@NormalMemberImpl.permission = new