Throw exception when a curl connection error occurs.