mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05: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:
parent
4873303658
commit
258b0acc51
1 changed files with 4 additions and 2 deletions
|
@ -203,7 +203,8 @@ module.exports.resourceNotFound = (req, res, next) => {
|
||||||
acceptVersion: req.headers['accept-version'],
|
acceptVersion: req.headers['accept-version'],
|
||||||
ghostVersion: `v${res.locals.safeVersion}`
|
ghostVersion: `v${res.locals.safeVersion}`
|
||||||
}),
|
}),
|
||||||
help: tpl(messages.methodNotAcceptableVersionAhead.help)
|
help: tpl(messages.methodNotAcceptableVersionAhead.help),
|
||||||
|
code: 'UPDATE_GHOST'
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
errorOptions = {
|
errorOptions = {
|
||||||
|
@ -214,7 +215,8 @@ module.exports.resourceNotFound = (req, res, next) => {
|
||||||
acceptVersion: req.headers['accept-version'],
|
acceptVersion: req.headers['accept-version'],
|
||||||
ghostVersion: `v${res.locals.safeVersion}`
|
ghostVersion: `v${res.locals.safeVersion}`
|
||||||
}),
|
}),
|
||||||
help: tpl(messages.methodNotAcceptableVersionBehind.help)
|
help: tpl(messages.methodNotAcceptableVersionBehind.help),
|
||||||
|
code: 'UPDATE_CLIENT'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue