aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Harvey Tuch <htuch@google.com>2018-06-21 13:05:27 -0400
committerGravatar Harvey Tuch <htuch@google.com>2018-06-21 13:57:31 -0400
commit44a2a2fcab63071375841d7a5001dd301ebac194 (patch)
tree8f28e4e1222a0fc25b6e8fced358b000eef88e6b /src
parent761a6275d4b7089db50dda22eb4241ba7f923769 (diff)
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: Harvey Tuch <htuch@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/google/protobuf/util/json_util.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/google/protobuf/util/json_util.cc b/src/google/protobuf/util/json_util.cc
index f81a7a30..dd8c6111 100644
--- a/src/google/protobuf/util/json_util.cc
+++ b/src/google/protobuf/util/json_util.cc
@@ -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,