Hi,
web::http::client::http_client client("http://10.18.26.63:8080");
client.request(web::http::methods::GET, ("/wm/device/")).then([=](pplx::task<web::http::http_response> task)
{
...
}
I have used the above code to establish an request at 10.18.26.63:8080 . If this server is running then it is working fine . But when the server is not running at this URL, The program is getting terminated abruptly with : error message as " Aborted(Core Dumped) ". How can i handle this ?
Comments: Hey srinivasdba Did you try to catch the exception from the response task in the continuation? ``` client.request(web::http::methods::GET, U("/wm/device/")).then([=](pplx::task<web::http::http_response> t) { try { auto resp = t.get(); } catch(const http_exception& ex) { std::cout << "exception:" << ex.what(); } }); ``` Upon execution, are you able to catch the exception? Does it still core dump after catching the exception? Thanks Kavya
web::http::client::http_client client("http://10.18.26.63:8080");
client.request(web::http::methods::GET, ("/wm/device/")).then([=](pplx::task<web::http::http_response> task)
{
...
}
I have used the above code to establish an request at 10.18.26.63:8080 . If this server is running then it is working fine . But when the server is not running at this URL, The program is getting terminated abruptly with : error message as " Aborted(Core Dumped) ". How can i handle this ?
Comments: Hey srinivasdba Did you try to catch the exception from the response task in the continuation? ``` client.request(web::http::methods::GET, U("/wm/device/")).then([=](pplx::task<web::http::http_response> t) { try { auto resp = t.get(); } catch(const http_exception& ex) { std::cout << "exception:" << ex.what(); } }); ``` Upon execution, are you able to catch the exception? Does it still core dump after catching the exception? Thanks Kavya