Skip to content

Commit

Permalink
provide slightly better error message when processing patterns - #5
Browse files Browse the repository at this point in the history
  • Loading branch information
diegocr committed Sep 16, 2014
1 parent a3abe42 commit fbbbd23
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
20 changes: 13 additions & 7 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
}
SPR[p[0]] = new RegExp(p[1]);
} catch(e) {
Cu.reportError(e);
reportError(e, p.join(":"));
}
});
},
Expand All @@ -231,7 +231,7 @@
try {
p = new RegExp(p);
} catch(e) {
Cu.reportError(e);
reportError(e, TP[0]);
return;
}

Expand All @@ -254,15 +254,15 @@
o = JSON.parse(p=this.p(TP[4]));
} catch(e) {
if(p) {
Cu.reportError(e);
reportError(e, p);
}
return;
}

try {
p = new RegExp(this.prefs[TP[0]]);
} catch(e) {
Cu.reportError(e);
reportError(e, TP[0]);
return;
}

Expand Down Expand Up @@ -291,7 +291,7 @@
this.s(TP[4],this.prefs[TP[4]] = JSON.stringify(o));
}
} catch(e) {
Cu.reportError(e);
reportError(e, TP[0]);
}
},

Expand Down Expand Up @@ -611,7 +611,7 @@
break;
}
} catch(e) {
Cu.reportError(e);
reportError(e, TP[0]);
}

let b = WM;
Expand All @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<em:id>{517f9e52-c795-4764-bf77-5e2db596cee6}</em:id>
<em:type>2</em:type>
<em:name>Preferences Monitor</em:name>
<em:version>3.6.1a1</em:version>
<em:version>3.7a1</em:version>
<em:creator>Diego Casorran &lt;[email protected]&gt;</em:creator>
<em:description>Track your Firefox's (about:config) preferences for unwanted changes.</em:description>
<em:bootstrap>true</em:bootstrap>
Expand All @@ -13,7 +13,7 @@
<!-- Firefox -->
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>4.0</em:minVersion>
<em:maxVersion>27.*</em:maxVersion>
<em:maxVersion>32.*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
Expand Down

0 comments on commit fbbbd23

Please sign in to comment.