I believe the authentication process does not occur until connect() time. Wrong credential should not have caused your connection to fail at the validation time.
If you are managing sessions to multiple servers, you could use a different SDK routine to do that. For example, assume your VCs are in a list of @VC and you can keep all the connections via a hash %VIM, like this:
You can also monitor the VIM connection and handle potential failure there. To do anything with that connection, such as find_entity_view():
my $vm = $VIM{$vc}->find_entity_view(view_type=>'VirtualMachine');