mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-04-15 23:42:22 +00:00
When proto.Unmarshal fails, it is almost always due to being passed input which is not a wire-format message. (A text-format message, a message with framing left intact, and so forth.) An error like "variable length integer overflow" can be confusing in this case, since it implies the problem is the varint rather than the input being entirely wrong. Replace all Unmarshal parse errors with "cannot parse invalid wire-format data". Change-Id: Id97253bd39ac604e569df71778194f37b3c86c28 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/244297 Reviewed-by: Joe Tsai <joetsai@google.com>