Currently, users may need to check both headers and trailers when looking for metadata in an error response for an operation with a unary reply (unary and client-stream RPCs). The reason they may have to look in two places is because where the metadata shows up isn't straight-forward - it depends on if the protocol being used and, if gRPC or gRPC-Web, whether the server used a trailers-only response or not. In a trailers-only response, all metadata would show up in the same bag of metadata (which are technically HTTP response headers, but may be classified as "trailers" since they include the status and there will be no subsequent HTTP response trailers in the reply).
This PR updates ConnectError's initialization to combine both headers + trailers into its metadata so that it's easier for consumers to query for the keys they need. This also matches connect-go and connect-es.
As described by @jhump:
This PR updates
ConnectError
's initialization to combine both headers + trailers into itsmetadata
so that it's easier for consumers to query for the keys they need. This also matches connect-go and connect-es.