]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
webui: protection for failures in comet callbacks
authorAdam Sutton <dev@adamsutton.me.uk>
Sun, 17 Nov 2013 20:55:40 +0000 (20:55 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Sun, 17 Nov 2013 20:55:40 +0000 (20:55 +0000)
Previously it was possible for such an error to result in a total failure of
the comet system.

src/webui/static/app/comet.js

index 74638788e21c745673a917bc3c1b132917b1da0c..68455ef5b431d90acb39e03c4bfce91b9201f6a7 100644 (file)
@@ -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);
        }