From bb61180ab8d6b1e34b8c3494621e795399cfb94b Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 2 Mar 2023 20:56:47 +0000 Subject: [PATCH] Add logging of response if Gitea API Call fails Signed-off-by: Fred Boniface --- src/configs/version.configs.js | 2 +- src/services/issue.services.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/configs/version.configs.js b/src/configs/version.configs.js index 1cc6a69..7eb7ae3 100644 --- a/src/configs/version.configs.js +++ b/src/configs/version.configs.js @@ -1,6 +1,6 @@ const version = { api: ["/api/v1/",], - app: "1.0.0" + app: "1.0.1" }; module.exports = version; \ No newline at end of file diff --git a/src/services/issue.services.js b/src/services/issue.services.js index 4bea3fb..e10597a 100644 --- a/src/services/issue.services.js +++ b/src/services/issue.services.js @@ -6,7 +6,7 @@ async function processor(data) { let out = {} out.title = data.subject.replace(/<[^>]+>|[\*\$]/g, ''); out.body = data.msg.replace(/<[^>]+>|[\*\$]/g, '') - sendToGitea(out); + return await sendToGitea(out); } async function sendToGitea(body) { @@ -23,7 +23,7 @@ async function sendToGitea(body) { log.out("issueService.sendToGitea: Issue sent to Gitea") return {status: res.status,message:"issue created"} } else { - log.out("issueService.sendToGitea: Failed to send issue to Gitea") + log.out(`issueService.sendToGitea: Failed to send issue to Gitea: ${res.body}`) return {status: res.status,message:"issue not created"} } }