From 0f3748cee1f444be999a44180290476254190f33 Mon Sep 17 00:00:00 2001 From: joseph le Date: Tue, 17 Oct 2023 07:34:37 +0700 Subject: [PATCH] Update function check status for other system --- app/utils/sendStatusOtherSystem.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/utils/sendStatusOtherSystem.js b/app/utils/sendStatusOtherSystem.js index 1f7c4ef..890620e 100644 --- a/app/utils/sendStatusOtherSystem.js +++ b/app/utils/sendStatusOtherSystem.js @@ -955,6 +955,7 @@ const checkMultipleRequest = async () => { }; const promises = requests.map(async (req, index) => { + try { if (req.method === "POST") { let response = await axios.post(req.url, req.data, { headers: req.headers, @@ -1137,6 +1138,16 @@ const checkMultipleRequest = async () => { }); } } + } catch (error) { + console.log("Error:", error); + report.push({ + group: req.group, + name: req.name, + status: ":red_circle:", + code: "bad", + lengthOrData: "Error: " + error, + }); + } }); await Promise.all(promises);