protobuf-go/proto
Damien Neil 01b51b4f96 proto, internal/errors: add Error sentinel, errors.Wrap
Add a sentinel proto.Error error which matches all errors returned by
packages in this module.

Document that protoregistry.NotFound is an exact sentinel value for
performance reasons.

Add a Wrap function to the internal/errors package and use it to wrap
errors from outside sources (resolvers). Wrapped errors match
proto.Error.

Fixes golang/protobuf#1021.

Change-Id: I45567df3fd6c8dc9a5caafdb55654827f6fb1941
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/215338
Reviewed-by: Joe Tsai <joetsai@google.com>
2020-02-07 21:09:48 +00:00
..
bench_test.go all: remove APIv1 dependency 2020-01-09 18:06:30 +00:00
decode_gen.go
decode_test.go encoding: add Format helper function and method 2020-01-30 07:50:58 +00:00
decode.go proto, internal/errors: add Error sentinel, errors.Wrap 2020-02-07 21:09:48 +00:00
doc.go
encode_gen.go
encode_test.go encoding: add Format helper function and method 2020-01-30 07:50:58 +00:00
encode.go runtime/protoiface: use more efficient options representation 2020-01-28 23:33:31 +00:00
equal_test.go proto, internal/protobuild: add test proto template builder 2020-02-03 19:14:55 +00:00
equal.go proto: fix equality on nil values of different types 2020-01-06 23:36:47 +00:00
extension_test.go proto, internal/protobuild: add test proto template builder 2020-02-03 19:14:55 +00:00
extension.go
isinit_test.go encoding: add Format helper function and method 2020-01-30 07:50:58 +00:00
isinit.go
merge_test.go proto, internal/protobuild: add test proto template builder 2020-02-03 19:14:55 +00:00
merge.go
messageset_test.go internal/impl: validate messagesets 2020-02-07 20:06:04 +00:00
messageset.go proto, internal/errors: add Error sentinel, errors.Wrap 2020-02-07 21:09:48 +00:00
methods_test.go all: do best-effort initialization check on fast path unmarshal 2020-01-22 20:57:14 +00:00
noenforceutf8_test.go
proto_methods.go all: add ProtoMethods method to protoreflect.Message 2020-01-21 21:05:54 +00:00
proto_reflect.go
proto.go proto, internal/errors: add Error sentinel, errors.Wrap 2020-02-07 21:09:48 +00:00
reset_test.go
reset.go
size_gen.go
size.go proto: add MarshalState, UnmarshalState 2020-01-22 20:52:17 +00:00
testmessages_test.go internal/impl: fix validation of required group fields 2020-02-07 20:05:54 +00:00
validate_test.go internal/impl: refactor validation a bit 2020-02-05 05:32:50 +00:00
weak_test.go internal/impl: add message validator 2020-01-07 21:36:47 +00:00
wrappers.go