Skip to content
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
45 changes: 28 additions & 17 deletions server/service/IndividualServicesService.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,11 @@ const EmbeddingCausesRequestForListOfApplicationsAtRo = async function (user, or
.map(item => ({ port: item.port, ipAddress: item.address['ip-address']['ipv-4-address'] }));

//check if MIDW is present
if (result != null)
if (result != null) {
resolve(result);
else
} else {
resolve(null);

}
} catch (error) {
reject(error);
}
Expand Down Expand Up @@ -1375,24 +1375,35 @@ async function PromptForUpdatingMacTableFromDeviceCausesWritingIntoElasticSearch
additionalHeaders //custom header
};


let response;
try {
let response = await axios.post(finalUrl, data, {
response = await axios.post(finalUrl, data, {
headers: headersAll
});
if (/^20[0-9]$/.test(response.status.toString())) //bug @216
{
logger.info("Writing (" + mountName + ") data into Elastic Search ");
return (response.data);
}
else {
logger.error("Writing operation into Elastic Search Failed (" + mountName + ")");
let err = new Error("Writing operation into Elastic Search Failed (" + mountName + ")", { cause: 204 } );
throw err;
}

} catch (error) {
throw error;
logger.debug(error);
// Remove data from logging. To big to print
let err = {
"message": error.message,
"stack": error.stack,
"config": {
"url": error.config.url,
"method": error.config.method
}
};

throw err;
}

if (/^20[0-9]$/.test(response.status.toString())) //bug @216
{
logger.info("Writing (" + mountName + ") data into Elastic Search ");
return (response.data);
}
else {
logger.error("Writing operation into Elastic Search Failed (" + mountName + ")");
let err = new Error("Writing operation into Elastic Search Failed (" + mountName + ")", { cause: 204 } );
throw err;
}

} catch (error) {
Expand Down
Loading