mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
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
1 changed files with 2 additions and 11 deletions
|
@ -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…
Add table
Reference in a new issue