simple curl error handling