From 3bb9c9531fb761e654953f2802292d4cdc0279be Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 30 Jan 2015 12:25:07 -0500 Subject: [PATCH 1/2] catch errors from static hook --- src/plugins/hooks.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/plugins/hooks.js b/src/plugins/hooks.js index 6a2751545a..1d6c6f8e7b 100644 --- a/src/plugins/hooks.js +++ b/src/plugins/hooks.js @@ -123,12 +123,18 @@ module.exports = function(Plugins) { next(); }, 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); - if (!timedOut) { - next.apply(null, arguments); - } - }); + next(); + } } else { next(); } From 60e052e788294d798f73f991ac7965da1290e579 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 30 Jan 2015 12:28:29 -0500 Subject: [PATCH 2/2] closes #2674 --- public/src/client/topic/threadTools.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/client/topic/threadTools.js b/public/src/client/topic/threadTools.js index 41a3d532bf..b401a850ed 100644 --- a/public/src/client/topic/threadTools.js +++ b/public/src/client/topic/threadTools.js @@ -61,7 +61,7 @@ define('forum/topic/threadTools', ['forum/topic/fork', 'forum/topic/move'], func fork.init(); $('.posts').on('click', '.follow', function() { - socket.emit('topics.follow', tid, function(err, state) { + socket.emit('topics.toggleFollow', tid, function(err, state) { if(err) { return app.alert({ type: 'danger',