0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Added error handling for ghost_head (#8982)

refs #8945

- Ensure that errors in ghost_head are logged
- Render some content despite the error!
This commit is contained in:
Hannah Wolfe 2017-09-07 09:29:44 +02:00 committed by Katharina Irrgang
parent d04e0f3a0c
commit 6c47285bba

View file

@ -17,6 +17,7 @@ var proxy = require('./proxy'),
filters = proxy.filters,
labs = proxy.labs,
api = proxy.api,
logging = proxy.logging,
settingsCache = proxy.settingsCache,
config = proxy.config,
blogIconUtils = proxy.blogIcon;
@ -168,5 +169,10 @@ module.exports = function ghost_head(options) {
return filters.doFilter('ghost_head', head);
}).then(function (head) {
return new SafeString(head.join('\n ').trim());
}).catch(function handleError(err) {
logging.error(err);
// Return what we have so far (currently nothing)
return new SafeString(head.join('\n ').trim());
});
};