From e2e5353ea948ee02b9dae9286f61f382f9ea6ae8 Mon Sep 17 00:00:00 2001 From: Rishabh Garg Date: Tue, 20 Nov 2018 12:13:35 +0530 Subject: [PATCH] Updated error message log and lastTriggeredError for webhook requests (#10147) closes #10145 - Updated lastTriggeredError message in case of failure - Removed GhostError in case of request failure and added proper warning --- core/server/services/webhooks/trigger.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/core/server/services/webhooks/trigger.js b/core/server/services/webhooks/trigger.js index e7e2cb4321..c8f8d8a61e 100644 --- a/core/server/services/webhooks/trigger.js +++ b/core/server/services/webhooks/trigger.js @@ -40,22 +40,13 @@ function makeRequests(webhooksCollection, payload, options) { common.logging.warn(`Unable to destroy webhook ${webhookId}`); }); } - let lastTriggeredError = err.statusCode ? '' : `Failed to send request to ${targetUrl}`; + let lastTriggeredError = err.statusCode ? '' : `Request failed: ${err.code || ''}`; updateWebhookTriggerData(webhookId, { last_triggered_at: triggeredAt, last_triggered_status: err.statusCode, last_triggered_error: lastTriggeredError }); - - common.logging.error(new common.errors.GhostError({ - err: err, - context: { - id: webhookId, - event: event, - target_url: targetUrl, - payload: payload - } - })); + common.logging.warn(`Request to ${targetUrl} failed ${err.code || ''}.`); }); }); }