mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 18:52:14 +03: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
@ -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…
Reference in New Issue
Block a user