mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Added sentry logging to 429 ping errors
issue https://github.com/TryGhost/Team/issues/362
This commit is contained in:
parent
a2dd7c7f7d
commit
6e58846c94
1 changed files with 5 additions and 2 deletions
|
@ -7,6 +7,7 @@ const {events, i18n} = require('../lib/common');
|
|||
const logging = require('../../shared/logging');
|
||||
const request = require('../lib/request');
|
||||
const settingsCache = require('./settings/cache');
|
||||
const sentry = require('../../shared/sentry');
|
||||
|
||||
const defaultPostSlugs = [
|
||||
'welcome',
|
||||
|
@ -83,12 +84,14 @@ function ping(post) {
|
|||
})
|
||||
.catch(function (err) {
|
||||
if (err.statusCode === 429) {
|
||||
logging.error(new errors.TooManyRequestsError({
|
||||
const error = new errors.TooManyRequestsError({
|
||||
err,
|
||||
message: err.message,
|
||||
context: i18n.t('errors.services.ping.requestFailed.error', {service: 'xmlrpc'}),
|
||||
help: i18n.t('errors.services.ping.requestFailed.help', {url: 'https://ghost.org/docs/'})
|
||||
}));
|
||||
});
|
||||
logging.error(error);
|
||||
sentry.captureException(error);
|
||||
} else {
|
||||
logging.error(new errors.GhostError({
|
||||
err: err,
|
||||
|
|
Loading…
Add table
Reference in a new issue