protobuf-go/proto
Damien Neil b5523e32b3 all: return less-specific, but more informative wire unmarshal errors
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>
2020-07-23 20:09:00 +00:00
..
bench_test.go all: remove APIv1 dependency 2020-01-09 18:06:30 +00:00
checkinit_test.go all: rename IsInitialized as CheckInitialized 2020-02-20 20:45:40 +00:00
checkinit.go all: consistently treat nil message interface as an empty read-only message 2020-04-20 23:12:56 +00:00
decode_gen.go all: return less-specific, but more informative wire unmarshal errors 2020-07-23 20:09:00 +00:00
decode_test.go all: implement support for proto3 optional semantics 2020-04-29 20:02:24 +00:00
decode.go all: return less-specific, but more informative wire unmarshal errors 2020-07-23 20:09:00 +00:00
doc.go all: rename IsInitialized as CheckInitialized 2020-02-20 20:45:40 +00:00
encode_gen.go encoding/protowire: make package publicly available 2020-03-20 07:42:18 +00:00
encode_test.go all: fix tests for 32-bit architectures 2020-07-08 22:37:09 +00:00
encode.go internal/order: add a package for ordered iteration over messages and maps 2020-07-01 18:57:38 +00:00
equal_test.go all: implement support for proto3 optional semantics 2020-04-29 20:02:24 +00:00
equal.go encoding/protowire: make package publicly available 2020-03-20 07:42:18 +00:00
extension_test.go all: implement support for proto3 optional semantics 2020-04-29 20:02:24 +00:00
extension.go all: improve extension validation 2020-04-23 06:01:13 +00:00
merge_test.go all: implement support for proto3 optional semantics 2020-04-29 20:02:24 +00:00
merge.go all: improve panic messages for better debugability 2020-05-05 21:10:54 +00:00
messageset_test.go testing/protopack: make package publicly available 2020-03-20 18:05:51 +00:00
messageset.go internal/order: add a package for ordered iteration over messages and maps 2020-07-01 18:57:38 +00:00
methods_test.go proto: fix signature of UnmarshalState and MarshalState 2020-03-09 20:02:17 +00:00
nil_test.go all: improve extension validation 2020-04-23 06:01:13 +00:00
noenforceutf8_test.go testing/protopack: make package publicly available 2020-03-20 18:05:51 +00:00
proto_methods.go all: add ProtoMethods method to protoreflect.Message 2020-01-21 21:05:54 +00:00
proto_reflect.go proto: reset message by default in Unmarshal 2019-09-17 21:13:42 +00:00
proto.go proto: document the relationship between v1 and v2 messages 2020-02-14 20:42:20 +00:00
reset_test.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
reset.go all: improve panic messages for better debugability 2020-05-05 21:10:54 +00:00
size_gen.go all: funnel similar functionality through a single function 2020-05-15 18:21:49 +00:00
size.go all: funnel similar functionality through a single function 2020-05-15 18:21:49 +00:00
testmessages_test.go all: return less-specific, but more informative wire unmarshal errors 2020-07-23 20:09:00 +00:00
validate_test.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
weak_test.go testing/protopack: make package publicly available 2020-03-20 18:05:51 +00:00
wrappers.go proto: move T->*T wrappers from internal/scalar to proto 2019-07-12 17:35:01 +00:00