Skip to content

Commit 1a4a1ba

Browse files
committed
Better error messages
1 parent 1c01958 commit 1a4a1ba

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

lib/har-driver-actor.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,12 @@ function ExportDriverApi(actor) {
276276
function securityCheck(method) {
277277
return function(options) {
278278
if (options.token != actor.token) {
279-
return win.Promise.reject(new win.Error("Wrong token"));
279+
let pref = "devtools.netmonitor.har.contentAPIToken";
280+
let msg = "Security check didn't pass. You need to set '" +
281+
pref + "' pref to match the string token passed into " +
282+
"HAR object API call (browser restart is required)";
283+
Cu.reportError(msg);
284+
return win.Promise.reject(new win.Error(msg));
280285
}
281286

282287
try {

lib/trigger-toolbox-overlay.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ const TriggerToolboxOverlay = Class(
139139
// Platform support is needed here.
140140
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1184889
141141
if (typeof getHarOverlay != "function") {
142-
Cu.reportError("Platform support needed, see Bug 1184889");
142+
Cu.reportError("Platform support needed, see Bug: " +
143+
"https://bugzilla.mozilla.org/show_bug.cgi?id=1184889");
143144
return;
144145
}
145146

0 commit comments

Comments
 (0)