Throw exception on cURL error.