Commit e11e05f5 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue when processing response from UDM

parent f4ed3538
...@@ -125,10 +125,9 @@ void ausf_client::curl_http_client( ...@@ -125,10 +125,9 @@ void ausf_client::curl_http_client(
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpCode); curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpCode);
// get the response // get the response
std::string response = *httpData.get(); response = *httpData.get();
std::string json_data_response = ""; std::string resMsg = "";
std::string resMsg = ""; bool is_response_ok = true;
bool is_response_ok = true;
Logger::ausf_app().info("Get response with httpcode (%d)", httpCode); Logger::ausf_app().info("Get response with httpcode (%d)", httpCode);
if (httpCode == 0) { if (httpCode == 0) {
...@@ -160,7 +159,7 @@ void ausf_client::curl_http_client( ...@@ -160,7 +159,7 @@ void ausf_client::curl_http_client(
if (!is_response_ok) { if (!is_response_ok) {
try { try {
response_data = nlohmann::json::parse(json_data_response); response_data = nlohmann::json::parse(response);
} catch (nlohmann::json::exception& e) { } catch (nlohmann::json::exception& e) {
Logger::ausf_app().info("Could not get Json content from the response"); Logger::ausf_app().info("Could not get Json content from the response");
// Set the default Cause // Set the default Cause
...@@ -168,7 +167,7 @@ void ausf_client::curl_http_client( ...@@ -168,7 +167,7 @@ void ausf_client::curl_http_client(
} }
Logger::ausf_app().info( Logger::ausf_app().info(
"Get response with jsonData: %s", json_data_response.c_str()); "Get response with jsonData: %s", response.c_str());
std::string cause = response_data["error"]["cause"]; std::string cause = response_data["error"]["cause"];
Logger::ausf_app().info("Call Network Function services failure"); Logger::ausf_app().info("Call Network Function services failure");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment