Merged in release/2025-02-28 (pull request #2127)

Add catch error handling.

Approved-by: Dave Richer
This commit is contained in:
Patrick Fic
2025-02-21 16:50:57 +00:00
committed by Dave Richer

View File

@@ -160,6 +160,13 @@ async function OpenSearchUpdateHandler(req, res) {
res.status(200).json(response.body);
}
} catch (error) {
logger.log("os-handler-error", "ERROR", null, null, {
id: req.body.event.data.new.id,
index: req.body.table.name,
message: error.message,
stack: error.stack
// body: document
});
res.status(400).json(JSON.stringify(error));
}
}