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
This commit is contained in:
parent
db34297a74
commit
e2e5353ea9
@ -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 || ''}.`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user