2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Added specific 'code' properties for RequestNotAcceptableError

refs https://github.com/TryGhost/Toolbox/issues/292

- There's a need to distinguish different types of RequestNotAcceptableError erros by their code. The code is also having an instructional name to give it more explicit utility (nice clue for a developer seeing the error)
This commit is contained in:
Naz 2022-04-20 15:44:26 +08:00
parent 4873303658
commit 258b0acc51

View file

@ -203,7 +203,8 @@ module.exports.resourceNotFound = (req, res, next) => {
acceptVersion: req.headers['accept-version'],
ghostVersion: `v${res.locals.safeVersion}`
}),
help: tpl(messages.methodNotAcceptableVersionAhead.help)
help: tpl(messages.methodNotAcceptableVersionAhead.help),
code: 'UPDATE_GHOST'
};
} else {
errorOptions = {
@ -214,7 +215,8 @@ module.exports.resourceNotFound = (req, res, next) => {
acceptVersion: req.headers['accept-version'],
ghostVersion: `v${res.locals.safeVersion}`
}),
help: tpl(messages.methodNotAcceptableVersionBehind.help)
help: tpl(messages.methodNotAcceptableVersionBehind.help),
code: 'UPDATE_CLIENT'
};
}