fix: failing tests @julianlam

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 3a23ddaba5
commit ecd622fdf5

@ -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();

Loading…
Cancel
Save