add userFriendly messages to PermissionsException (#13659)
/closes #13580 <img width="1186" height="754" alt="image" src="https://github.com/user-attachments/assets/d5be9e3a-2748-4ad0-b29b-98038cbeeb6a" />
This commit is contained in:
@@ -122,6 +122,10 @@ export class UserService extends TypeOrmQueryService<User> {
|
||||
throw new PermissionsException(
|
||||
PermissionsExceptionMessage.CANNOT_DELETE_LAST_ADMIN_USER,
|
||||
PermissionsExceptionCode.CANNOT_DELETE_LAST_ADMIN_USER,
|
||||
{
|
||||
userFriendlyMessage:
|
||||
'Cannot delete account: you are the only admin. Assign another admin or delete the workspace(s) first.',
|
||||
},
|
||||
);
|
||||
}
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user