mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -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:
parent
7acd165d7a
commit
b70867c973
1 changed files with 6 additions and 1 deletions
|
@ -234,7 +234,12 @@ Ghost.prototype.doFilter = function (name, args, callback) {
|
||||||
|
|
||||||
// Call each handler for this priority level
|
// Call each handler for this priority level
|
||||||
_.each(callbacks[priority], function (filterHandler) {
|
_.each(callbacks[priority], function (filterHandler) {
|
||||||
args = filterHandler(args);
|
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);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue