Commit 44a2a2fc authored by Harvey Tuch's avatar Harvey Tuch

json: include field name in InvalidName status messages.

This is invaluable for chasing down the culprit in failed JSON -> proto
conversions. We often see in Envoy that a failed JSON (or indirectly via
YAML) configuration won't load but it's unclear why.
Signed-off-by: 's avatarHarvey Tuch <htuch@google.com>
parent 761a6275
......@@ -127,7 +127,8 @@ class StatusErrorListener : public converter::ErrorListener {
virtual void InvalidName(const converter::LocationTrackerInterface& loc,
StringPiece unknown_name, StringPiece message) {
status_ = util::Status(util::error::INVALID_ARGUMENT,
loc.ToString() + ": " + string(message));
loc.ToString() + ":invalid name " +
string(unknown_name) + ": " + string(message));
}
virtual void InvalidValue(const converter::LocationTrackerInterface& loc,
......
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