More accurately report text parsing failures for invalid strings.
diff --git a/proto/text_parser.go b/proto/text_parser.go
index 5c466d5..7d0c757 100644
--- a/proto/text_parser.go
+++ b/proto/text_parser.go
@@ -174,7 +174,7 @@
}
unq, err := unquoteC(p.s[1:i], rune(p.s[0]))
if err != nil {
- p.errorf("invalid quoted string %v", p.s[0:i+1])
+ p.errorf("invalid quoted string %s: %v", p.s[0:i+1], err)
return
}
p.cur.value, p.s = p.s[0:i+1], p.s[i+1:len(p.s)]
diff --git a/proto/text_parser_test.go b/proto/text_parser_test.go
index cfc0db6..0754b26 100644
--- a/proto/text_parser_test.go
+++ b/proto/text_parser_test.go
@@ -152,7 +152,7 @@
// Bad quoted string
{
in: `inner: < host: "\0" >` + "\n",
- err: `line 1.15: invalid quoted string "\0"`,
+ err: `line 1.15: invalid quoted string "\0": \0 requires 2 following digits`,
},
// Number too large for int64