catch exceptions in TestConnection