-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
In the branch gce_error_details, Showcase populates an array of error details, These details are declared as repeated google.protobuf.Any details here, but the JSON-encoded error response does not populate the @type field of each Any-type element of details. The JSON encoding of google.protobuf.Any should include such a field (ref).
If I start the Showcase server from that branch and then I run curl, this is what I get (notice the lack of @type fields):
> curl -i -X POST -H "X-Goog-Api-Client: rest/0.0.0 gapic/0.0.0" -H 'Content-Type: application/json' http://localhost:7469/v1beta1/echo:echo -d'{"error": {"code": 8,"message":"Main error message"}, "generateErrorDetails": true} '
HTTP/1.1 429 Too Many Requests
Date: Thu, 25 Apr 2024 23:07:46 GMT
Content-Length: 1292
Content-Type: text/plain; charset=utf-8
{"error":{"code":429,"message":"Main error message","details":[{"reason":"(showcase:ErrorInfo) RPC requested we populate all error details","domain":"googleapis.com"},{"retry_delay":{"seconds":3,"nanos":14159265}},{"stack_entries":["frame 1","frame 2","frame3"],"detail":"(showcase:DebugInfo) sample stack frames"},{"violations":[{"subject":"(showcase:QuotaFailure) showcase-testing:fake errors","description":"This is fake quota error 0"},{"subject":"(showcase:QuotaFailure) showcase-testing:more fake errors","description":"This is fake quota error 1"}]},{"violations":[{"type":"Fake Type 0","subject":"(showcase:PreconditionFailure) showcase-testing:fake errors","description":"This is fake precondition error 0"},{"type":"Fake Type 1","subject":"(showcase:PreconditionFailure) showcase-testing:fake errors","description":"This is fake precondition error 1"}]},{"field_violations":[{"field":"field 0","description":"(showcase:BadRequest) description 0"},{"field":"field 1","description":"(showcase:BadRequest) description 1"}]},{"links":[{"description":"(showcase:Help) Description 0","url":"URL 0"},{"description":"(showcase:Help) Description 1","url":"URL 1"}]},{"locale":"en-US","message":"(showcase:LocalizedMessage) Some message for the user"}],"Body":"","Header":null,"Errors":null}}%
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.