fix: failing tests @julianlam

This commit is contained in:
Barış Soner Uşaklı
2020-05-04 15:02:04 -04:00
parent 3a23ddaba5
commit ecd622fdf5

View File

@@ -84,6 +84,7 @@ middleware.pageView = function pageView(req, res, next) {
middleware.pluginHooks = async function pluginHooks(req, res, next) { middleware.pluginHooks = async function pluginHooks(req, res, next) {
// TODO: Deprecate in v2.0 // TODO: Deprecate in v2.0
try {
await async.each(plugins.loadedHooks['filter:router.page'] || [], function (hookObj, next) { await async.each(plugins.loadedHooks['filter:router.page'] || [], function (hookObj, next) {
hookObj.method(req, res, next); hookObj.method(req, res, next);
}); });
@@ -92,6 +93,9 @@ middleware.pluginHooks = async function pluginHooks(req, res, next) {
req: req, req: req,
res: res, res: res,
}); });
} catch (err) {
return next(err);
}
if (!res.headersSent) { if (!res.headersSent) {
next(); next();