Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observing 500 error with API : http://xx:xx/v1/provide-list-of-network-element-interfaces-on-path #211

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions server/service/IndividualServicesService.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ const RequestForListOfNetworkElementInterfacesOnPathCausesReadingFromElasticSear
let result = null;
let resultString = null;


let client = await elasticsearchService.getClient(false);

try {
Expand Down Expand Up @@ -672,6 +673,22 @@ const RequestForListOfNetworkElementInterfacesOnPathCausesReadingFromElasticSear
transformedArray = filteredObjects.map(obj => transformData(obj));

if (transformedArray != null) {
var response = {};
response['application/json'] = {
'targetMacAddress': transformedArray
};

if (Object.keys(response).length > 0) {
resolve(response['application/json']['targetMacAddress']);
} else {
resolve();
}
}
} catch (error) {
reject(error);
}

/* if (transformedArray != null) {
result = generateMountAndEgressPairs(transformedArray);

if (result != null)
Expand All @@ -686,10 +703,7 @@ const RequestForListOfNetworkElementInterfacesOnPathCausesReadingFromElasticSear
}
}
else
resolve(null);
} catch (error) {
reject(error);
}
resolve(null);*/

});
};
Expand Down Expand Up @@ -1333,15 +1347,15 @@ async function PromptForUpdatingMacTableFromDeviceCausesWritingIntoElasticSearch
if (response.status === 200)
return (response.data);
else {
throw error;
throw new Error("Writing operation into Elastic Search Failed (" + mountName + ")");
}

} catch (error) {
throw error;
}

} catch (error) {
throw new Error("Writing operation into Elastic Search Failed (" + mountName + ")");
throw error;
}
}

Expand Down
Loading