mirror of
https://github.com/plankanban/planka.git
synced 2025-12-18 09:13:21 +03:00
fix: Fix application crashing when webhook is unavailable (#815)
This commit is contained in:
@@ -116,6 +116,7 @@ async function sendWebhook(webhook, event, data, user) {
|
|||||||
user: sails.helpers.utils.jsonifyRecord(user),
|
user: sails.helpers.utils.jsonifyRecord(user),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
const response = await fetch(webhook.url, {
|
const response = await fetch(webhook.url, {
|
||||||
headers,
|
headers,
|
||||||
body,
|
body,
|
||||||
@@ -129,6 +130,9 @@ async function sendWebhook(webhook, event, data, user) {
|
|||||||
`Webhook ${webhook.url} failed with status ${response.status} and message: ${message}`,
|
`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 = {
|
module.exports = {
|
||||||
|
|||||||
Reference in New Issue
Block a user