From 546b419f52a741c150874fd233d91b88e88fa71a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 10 Aug 2016 12:23:35 +0300 Subject: [PATCH] catch plugin JS errors --- index.php | 5 +++++ js/tt-rss.js | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 36734619f..6b27d9042 100644 --- a/index.php +++ b/index.php @@ -118,7 +118,12 @@ 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); + }"; } } diff --git a/js/tt-rss.js b/js/tt-rss.js index e5e7a848f..78feb6ea3 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -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;