From 7d8360edddc4e76e8ee1b3c43550dbde349b70ee Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Sun, 17 Nov 2013 20:55:40 +0000 Subject: [PATCH] webui: protection for failures in comet callbacks Previously it was possible for such an error to result in a total failure of the comet system. --- src/webui/static/app/comet.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/webui/static/app/comet.js b/src/webui/static/app/comet.js index 74638788..68455ef5 100644 --- a/src/webui/static/app/comet.js +++ b/src/webui/static/app/comet.js @@ -60,7 +60,11 @@ tvheadend.cometPoller = function() { tvheadend.boxid = response.boxid for (x = 0; x < response.messages.length; x++) { m = response.messages[x]; - tvheadend.comet.fireEvent(m.notificationClass, m); + try { + tvheadend.comet.fireEvent(m.notificationClass, m); + } catch (e) { + tvheadend.log('comet failure [e=' + e.message + ']'); + } } cometRequest.delay(100); }