about the problem of jsoncpp parse json

void main(){
CURL curl;
CURLcode res;
stringstream response;
string error;
curl_global_init;
curl = curl_easy_init;
if
{
curl_easy_setopt;
curl_easy_setopt;
curl_easy_setopt;
res = curl_easy_perform;
curl_easy_cleanup;
}
Json::Value root;
Json::Reader reader;
bool parsingSuccessful = reader.parse, root);
if
{
return ;
}
string b=root.asString;
int a=root.asInt;
return ;
}
static size_t write_data
{
cout << “—>write_data” << endl;
string buf = string, size
nmemb);
stringstream * response = static_cast<stringstream *>(stream);
response->write(buf.c_str(), (streamsize)buf.size());
return size * nmemb;

}

when parsing root[“res”][“expand”] to string will be done well.
but parse it to int ,the problem will catch runtime_error;