better error testing for connect in test