Set and return curl error in the event that the call was not successful.