I am working on a C++ program, which uses cURL library, which is written in plain C. When I try to connect to an incorrect URL address with cURL handle I get such an exception :
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct NULL not valid
and my program terminates instead of skipping this URL and going futher. Here is snippet of my code:
CURL* curl;
curl_easy_setopt( curl, CURLOPT_URL, "incorrect URL" );
curl_easy_perform( curl ); // this method throws the expection
I tried to handle it like this :
try{
curl_easy_perform( curl );
} catch { std::logic_error &e){
return -1; // skip this URL and go futher
}
But still program terminates and it seems that exception is not handled properly.
The file "stdexcept" is included.
Does anyone knows some more about this error and how to catch this exception properly so I my program can keep on working?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)