Raise error if connection failed