From: Adam Sutton Date: Sun, 17 Nov 2013 20:55:40 +0000 (+0000) Subject: webui: protection for failures in comet callbacks X-Git-Tag: v4.1~2398 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7d8360edddc4e76e8ee1b3c43550dbde349b70ee;p=thirdparty%2Ftvheadend.git 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. --- diff --git a/src/webui/static/app/comet.js b/src/webui/static/app/comet.js index 74638788e..68455ef5b 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); }