From fbbbd23dfb04c679c3ee949264775a2613185323 Mon Sep 17 00:00:00 2001 From: diegocr Date: Tue, 16 Sep 2014 12:18:15 +0000 Subject: [PATCH] provide slightly better error message when processing patterns - #5 --- bootstrap.js | 20 +++++++++++++------- install.rdf | 4 ++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/bootstrap.js b/bootstrap.js index 6dfe985..b5c64a1 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -215,7 +215,7 @@ } SPR[p[0]] = new RegExp(p[1]); } catch(e) { - Cu.reportError(e); + reportError(e, p.join(":")); } }); }, @@ -231,7 +231,7 @@ try { p = new RegExp(p); } catch(e) { - Cu.reportError(e); + reportError(e, TP[0]); return; } @@ -254,7 +254,7 @@ o = JSON.parse(p=this.p(TP[4])); } catch(e) { if(p) { - Cu.reportError(e); + reportError(e, p); } return; } @@ -262,7 +262,7 @@ try { p = new RegExp(this.prefs[TP[0]]); } catch(e) { - Cu.reportError(e); + reportError(e, TP[0]); return; } @@ -291,7 +291,7 @@ this.s(TP[4],this.prefs[TP[4]] = JSON.stringify(o)); } } catch(e) { - Cu.reportError(e); + reportError(e, TP[0]); } }, @@ -611,7 +611,7 @@ break; } } catch(e) { - Cu.reportError(e); + reportError(e, TP[0]); } let b = WM; @@ -632,7 +632,7 @@ if(new RegExp(j).test(dL)) break; } catch(e) { - Cu.reportError(e); + reportError(e, TP[2]); } let n = b.getNotificationBox(), bn = "More Info", pn; @@ -711,6 +711,12 @@ QueryInterface: XPCOMUtils.generateQI(Ci.nsIConsoleListener) }; + + function reportError(ex, m) + { + if (m) Cu.reportError('Error processing "'+m+'" -> ' + ex); + else Cu.reportError(ex); + } let sTimer; function setTimeout(f,n) { diff --git a/install.rdf b/install.rdf index ffb537f..c0f383c 100644 --- a/install.rdf +++ b/install.rdf @@ -4,7 +4,7 @@ {517f9e52-c795-4764-bf77-5e2db596cee6} 2 Preferences Monitor - 3.6.1a1 + 3.7a1 Diego Casorran <dcasorran@gmail.com> Track your Firefox's (about:config) preferences for unwanted changes. true @@ -13,7 +13,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 4.0 - 27.* + 32.*