mirror of
https://github.com/plankanban/planka.git
synced 2025-08-08 23:15:31 +02:00
fix: webhooks fetch wrapped into try catch
This commit is contained in:
parent
72896a66b3
commit
880a27770b
1 changed files with 14 additions and 8 deletions
|
@ -116,6 +116,7 @@ async function sendWebhook(webhook, event, data, user) {
|
|||
user: sails.helpers.utils.jsonifyRecord(user),
|
||||
});
|
||||
|
||||
try {
|
||||
const response = await fetch(webhook.url, {
|
||||
headers,
|
||||
body,
|
||||
|
@ -129,6 +130,11 @@ async function sendWebhook(webhook, event, data, user) {
|
|||
`Webhook ${webhook.url} failed with status ${response.status} and message: ${message}`,
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
sails.log.error(
|
||||
`Webhook ${webhook.url} failed with error message: ${e.message}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue