Add logging of response if Gitea API Call fails
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
@@ -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"}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user