Skip to content

Commit

Permalink
print pref path in 'already registered' error message
Browse files Browse the repository at this point in the history
This CL changes the error message about an already
observed pref path to mention the path in the error.
e.g.
  Check failed: !IsObserved(path). Already had pref, "session.startup_urls", registered.

BUG=None

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

Cr-Commit-Position: refs/heads/master@{#379057}
  • Loading branch information
dschuyler authored and Commit bot committed Mar 3, 2016
1 parent 969c512 commit c610bcc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/prefs/pref_change_registrar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ void PrefChangeRegistrar::Add(const std::string& path,
NOTREACHED();
return;
}
DCHECK(!IsObserved(path)) << "Already had this pref registered.";
DCHECK(!IsObserved(path)) << "Already had pref, \"" << path
<< "\", registered.";

service_->AddPrefObserver(path, this);
observers_[path] = obs;
Expand Down

0 comments on commit c610bcc

Please sign in to comment.