]> git.wh0rd.org Git - tt-rss.git/commitdiff
catch plugin JS errors
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Wed, 10 Aug 2016 09:23:35 +0000 (12:23 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Wed, 10 Aug 2016 09:23:35 +0000 (12:23 +0300)
index.php
js/tt-rss.js

index 36734619ffd457c300c47b61cffa8181b1a27c05..6b27d90425e72fb9c4c9ebd1f0dc950140d5a812 100644 (file)
--- a/index.php
+++ b/index.php
 
                foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
                        if (method_exists($p, "get_js")) {
+                               echo "try {";
                                echo JShrink\Minifier::minify($p->get_js());
+                               echo "} catch (e) {
+                                       console.warn('failed to initialize plugin JS: $n');
+                                       console.warn(e);
+                               }";
                        }
                }
 
index e5e7a848f51d0da21afbcf82558d312c00b3c527..78feb6ea32f22ce53ccb788a140f2801b8df4f53 100644 (file)
@@ -218,10 +218,10 @@ function init() {
        try {
                //dojo.registerModulePath("fox", "../../js/");
 
-               require(['dojo/_base/kernel',
-                               'dojo/ready',
-                               'dojo/parser',
-                               'dojo/_base/loader',
+               require(["dojo/_base/kernel",
+                               "dojo/ready",
+                               "dojo/parser",
+                               "dojo/_base/loader",
                                "dijit/ProgressBar",
                                "dijit/ColorPalette",
                                "dijit/Dialog",
@@ -254,7 +254,7 @@ function init() {
 
                                        dojo.require("fox.FeedTree");
 
-                                       dojo.parser.parse();
+                                       parser.parse();
 
                                        if (!genericSanityCheck())
                                                return false;