1
Vote

Compilation internal error is coming while compiling "pplx::task_from_result" statement

description

HI all,
I am using Visual Stuio 2010 and C++ Rest SDK 1.2.0. I am trying to call web service (GET). So while compiling the code am getting "An internal error has occurred in the compiler. 1> (compiler file f:\dd\vctools\compiler\utc\src\p2\ehexcept.c " error only when I add the state ment "pplx::task_from_result(web::json::value());"

Code:
return client.request(methods::GET).then([](http_response response)->pplx::task<web::json::value>{
    if(response.status_code() == status_codes::OK)
    {
        return response.extract_json();
    }
    else
    {
        return  pplx::task_from_result(web::json::value());
    }
    // Handle error cases, for now return empty json value... 
    //return pplx::task_from_result(json::value());
}).then([](pplx::task<web::json::value> previousTask){
    try
    {
        const web::json::value& v = previousTask.get();
        //DisplayJSONValue(v);
        // Perform actions here to process the JSON value...
    }
    catch (const http_exception& e)
    {
    }

comments