mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 18:52:14 +03:00
Removed redundant errorDetail and context stringification in errors (#10572)
no issue - Additional JSON.stringify call is redundant because it is already happening internally in Ignition (https://github.com/TryGhost/Ignition/blob/master/lib/logging/GhostLogger.js#L241) - Left stringification in importer as is, because the use case there is also putting errors into 'problems' array and seems like those values have to be stringified
This commit is contained in:
parent
4428ed5f79
commit
9810834f7b
@ -372,7 +372,7 @@ validateRedirects = function validateRedirects(redirects) {
|
||||
if (!redirect.from || !redirect.to) {
|
||||
throw new common.errors.ValidationError({
|
||||
message: common.i18n.t('errors.utils.redirectsWrongFormat'),
|
||||
context: JSON.stringify(redirect),
|
||||
context: redirect,
|
||||
help: 'https://docs.ghost.org/concepts/redirects/'
|
||||
});
|
||||
}
|
||||
|
@ -63,11 +63,11 @@ module.exports = function (Bookshelf) {
|
||||
message: 'Saving failed! Someone else is editing this post.',
|
||||
code: 'UPDATE_COLLISION',
|
||||
level: 'critical',
|
||||
context: JSON.stringify({
|
||||
context: {
|
||||
clientUpdatedAt: self.clientData.updated_at,
|
||||
serverUpdatedAt: self.serverData.updated_at,
|
||||
changed: changed
|
||||
})
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ module.exports = {
|
||||
common.logging.warn(new common.errors.ThemeValidationError({
|
||||
errorType: 'ThemeWorksButHasErrors',
|
||||
message: common.i18n.t('errors.middleware.themehandler.themeHasErrors', {theme: activeThemeName}),
|
||||
errorDetails: JSON.stringify(checkedTheme.results.error, null, '\t')
|
||||
errorDetails: checkedTheme.results.error
|
||||
}));
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ module.exports = {
|
||||
if (err.errorDetails) {
|
||||
common.logging.error(new common.errors.ThemeValidationError({
|
||||
message: common.i18n.t('errors.middleware.themehandler.invalidTheme', {theme: activeThemeName}),
|
||||
errorDetails: JSON.stringify(err.errorDetails, null, '\t')
|
||||
errorDetails: err.errorDetails
|
||||
}));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user