Closed optiman closed 3 years ago
To clarify how this works:
On import of google.golang.org/genproto/googleapis/rpc/errdetails
package
func init() { file_google_rpc_error_details_proto_init() }
is executed, which runs method Build()
on protoimpl.TypeBuilder
that registers all message types from this package in protoregistry.GlobalTypes
.
Then, before emitting eventInPayloadReceived
formatPayload()
is executed, where prototext.MarshalOptions
is using protoregistry.GlobalTypes
as a type resolver by default to automatically marshal google.protobuf.Any
fields if its TypeUrl
was registered beforehand in the resolver.
Thanks @optiman. Looks good. Do you mind updating the CHANGELOG.md
file in the "Unreleased" section? Don't forget to add your name to get the credit 😄
Ok, done.
Richer error model All
errdetails
types are registered ininit()
ofgoogle.golang.org/genproto/googleapis/rpc/errdetails
package. Just needed to import it.Before:
After: