mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
catch errors from static hook
This commit is contained in:
@@ -123,12 +123,18 @@ module.exports = function(Plugins) {
|
||||
next();
|
||||
}, 5000);
|
||||
|
||||
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);
|
||||
next();
|
||||
}
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user