mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +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 logging = require('../../shared/logging');
|
||||||
const request = require('../lib/request');
|
const request = require('../lib/request');
|
||||||
const settingsCache = require('./settings/cache');
|
const settingsCache = require('./settings/cache');
|
||||||
|
const sentry = require('../../shared/sentry');
|
||||||
|
|
||||||
const defaultPostSlugs = [
|
const defaultPostSlugs = [
|
||||||
'welcome',
|
'welcome',
|
||||||
@ -83,12 +84,14 @@ function ping(post) {
|
|||||||
})
|
})
|
||||||
.catch(function (err) {
|
.catch(function (err) {
|
||||||
if (err.statusCode === 429) {
|
if (err.statusCode === 429) {
|
||||||
logging.error(new errors.TooManyRequestsError({
|
const error = new errors.TooManyRequestsError({
|
||||||
err,
|
err,
|
||||||
message: err.message,
|
message: err.message,
|
||||||
context: i18n.t('errors.services.ping.requestFailed.error', {service: 'xmlrpc'}),
|
context: i18n.t('errors.services.ping.requestFailed.error', {service: 'xmlrpc'}),
|
||||||
help: i18n.t('errors.services.ping.requestFailed.help', {url: 'https://ghost.org/docs/'})
|
help: i18n.t('errors.services.ping.requestFailed.help', {url: 'https://ghost.org/docs/'})
|
||||||
}));
|
});
|
||||||
|
logging.error(error);
|
||||||
|
sentry.captureException(error);
|
||||||
} else {
|
} else {
|
||||||
logging.error(new errors.GhostError({
|
logging.error(new errors.GhostError({
|
||||||
err: err,
|
err: err,
|
||||||
|
Loading…
Reference in New Issue
Block a user