form set error is not working properly I am using Drupal 7 

i am tracking login and setting errors but my error is not working properly 

here is my code 

  &lt;?php 


    function zloginsecurity_form_alter(&amp;$form, &amp;$form_state, $form_id) 
    {
        switch ($form_id)  {
        case 'user_login':
        case 'user_login_block':
           $form['#validate'] = zloginsecurity_validators();
          break;
      }
    }

    function zloginsecurity_validators() {
        return array('user_login_name_validate', 'user_login_authenticate_validate', 'user_login_final_validate','zloginsecurity_validate');
    }

    function zloginsecurity_validate($form, &amp;$form_state) {
           if (empty($form_state['uid'])) {
            //Check user Track Record 
            echo "hello"; 
     form_set_error('name', t('hello test'));
          }else {
              zloginsecurity_removeevent();     
            //Delete Track Records for Particualr user 
        }

    }




 ?&gt;


it is not showing hello test, it is showing default message .  Can anybody tell me how to solve this issue.   simple echo is working

Thanks
In form_set_error, the first parameter should be form name, if you are not sure of the name, just leave empty.

form_set_error('', t('hello test'));


This should work just fine.

UPDATED ANSWER

If you would like to have only your validation and skip the rest of Drupal core's validation for that particular form, you can unset the validator function and inject your own.

unset($form['#validate']);
$form['#validate'][] = 'zloginsecurity_validators';


Or

If you like to have both and give priority to yours first, then

$default_validators = $form['#validate'];
unset($form['#validate']);
$form['#validate'][] = 'zloginsecurity_validators';
foreach ($default_validators as $val) {
  $form['#validate'][] = $val;
}