0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

🐛 HTML page error: correct templateData (#9144)

no issue

- `this.statusCode` was always undefined
- see HTML error handler
- it's hard to add a test for this case
- manual test only
This commit is contained in:
Katharina Irrgang 2017-10-13 15:26:42 +02:00 committed by Hannah Wolfe
parent 9f9d8b2fec
commit 8de691d575
2 changed files with 8 additions and 5 deletions

View file

@ -84,6 +84,7 @@ function getAjaxHelper(clientId, clientSecret) {
module.exports = function ghost_head(options) { module.exports = function ghost_head(options) {
debug('begin'); debug('begin');
// if server error page do nothing // if server error page do nothing
if (this.statusCode >= 500) { if (this.statusCode >= 500) {
return; return;

View file

@ -81,11 +81,13 @@ _private.HTMLErrorRenderer = function HTMLErrorRender(err, req, res, next) {
} }
var templateData = { var templateData = {
message: err.message, message: err.message,
code: err.statusCode, // @deprecated
errorDetails: err.errorDetails || [] code: err.statusCode,
}, statusCode: err.statusCode,
template = templates.error(err.statusCode); errorDetails: err.errorDetails || []
},
template = templates.error(err.statusCode);
// It can be that something went wrong with the theme or otherwise loading handlebars // It can be that something went wrong with the theme or otherwise loading handlebars
// This ensures that no matter what res.render will work here // This ensures that no matter what res.render will work here