0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Filters should not stop execution.

- added a try-catch & error logging to filters so that they can be debugged and do not stop execution
This commit is contained in:
Hannah Wolfe 2013-07-07 19:02:26 +01:00
parent 7acd165d7a
commit b70867c973

View file

@ -234,7 +234,12 @@ Ghost.prototype.doFilter = function (name, args, callback) {
// Call each handler for this priority level
_.each(callbacks[priority], function (filterHandler) {
try {
args = filterHandler(args);
} catch (e) {
// If a filter causes an error, we log it so that it can be debugged, but do not throw the error
errors.logError(e);
}
});
});