🐛 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) {
debug('begin');
// if server error page do nothing
if (this.statusCode >= 500) {
return;

View File

@ -81,11 +81,13 @@ _private.HTMLErrorRenderer = function HTMLErrorRender(err, req, res, next) {
}
var templateData = {
message: err.message,
code: err.statusCode,
errorDetails: err.errorDetails || []
},
template = templates.error(err.statusCode);
message: err.message,
// @deprecated
code: err.statusCode,
statusCode: err.statusCode,
errorDetails: err.errorDetails || []
},
template = templates.error(err.statusCode);
// 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