Raise an exception if we fail to connect