Error handling of cURL errors