mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
catch errors from static hook
This commit is contained in:
@@ -123,12 +123,18 @@ module.exports = function(Plugins) {
|
|||||||
next();
|
next();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
hookObj.method(params, function() {
|
try {
|
||||||
|
hookObj.method(params, function() {
|
||||||
|
clearTimeout(timeoutId);
|
||||||
|
if (!timedOut) {
|
||||||
|
next.apply(null, arguments);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch(err) {
|
||||||
|
winston.error('[plugins] Error executing \'' + hook + '\' in plugin \'' + hookObj.id + '\'');
|
||||||
clearTimeout(timeoutId);
|
clearTimeout(timeoutId);
|
||||||
if (!timedOut) {
|
next();
|
||||||
next.apply(null, arguments);
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user