0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

🎨 optimise error handling (#8378)

no issue
- if you start Ghost and you theme is invalid, you only get a warning, but no reason
- furthermore, if any error is thrown in Ghost, which is not a custom Ignition error, we take care that the error message to inherit from shows up
This commit is contained in:
Katharina Irrgang 2017-04-24 19:46:10 +02:00 committed by Kevin Ansfield
parent e745198d5e
commit 2300219016
2 changed files with 6 additions and 2 deletions

View file

@ -80,6 +80,7 @@ _private.prepareError = function prepareError(err, req, res, next) {
} else {
err = new errors.GhostError({
err: err,
message: err.message,
statusCode: err.statusCode
});
}

View file

@ -39,9 +39,12 @@ module.exports = {
debug('Activating theme (method A on boot)', activeThemeName);
self.activate(theme, checkedTheme);
})
.catch(function () {
.catch(function (err) {
// Active theme is not valid, we don't want to exit because the admin panel will still work
logging.warn(i18n.t('errors.middleware.themehandler.invalidTheme', {theme: activeThemeName}));
logging.error(new errors.InternalServerError({
message: i18n.t('errors.middleware.themehandler.invalidTheme', {theme: activeThemeName}),
err: err
}));
});
})
.catch(function () {