Connect returns different error codes for different errors