Commit b1bfa026 authored by jlklein's avatar jlklein Committed by Commit bot

Use parent host outer html as the key hint for pref errors.

BUG=

Review URL: https://codereview.chromium.org/1148303007

Cr-Commit-Position: refs/heads/master@{#333174}
parent cce34d58
...@@ -68,14 +68,11 @@ ...@@ -68,14 +68,11 @@
// HACK ALERT: This is the best clue we have as to the pref key for // HACK ALERT: This is the best clue we have as to the pref key for
// this tracker. This value should not be relied upon anywhere or // this tracker. This value should not be relied upon anywhere or
// actually used besides for this error message. // actually used besides for this error message.
var keyHint = ''; var parentControlHTML = this.parentNode && this.parentNode.host &&
var parentPrefString = this.parentNode && this.parentNode.host && this.parentNode.host.outerHTML;
this.parentNode.host.getAttribute('pref');
if (parentPrefString) {
keyHint = parentPrefString.match(/{{([a-z0-9._]+)}}/)[1];
}
throw new Error('Pref not found. Key Hint: ' + keyHint); throw new Error('Pref not found. Parent control:' +
(parentControlHTML || 'Unknown');
} }
}); });
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment