Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1098: remove error field from error messages #1242

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/internal/clients/abe/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ go_library(
"model_pathenum_path_enum.go",
"model_protobuf_any.go",
"model_protobuf_field_mask.go",
"model_runtime_error.go",
"model_rpc_status.go",
"model_sub_string_message.go",
"response.go",
],
Expand Down
50 changes: 24 additions & 26 deletions examples/internal/clients/abe/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v1/example/a_bit_of_everything/echo/{value}:
get:
tags:
Expand Down Expand Up @@ -104,7 +104,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
externalDocs:
description: "Find out more Echo"
url: "https://github.com/grpc-ecosystem/grpc-gateway"
Expand Down Expand Up @@ -395,7 +395,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v1/example/a_bit_of_everything/params/get/{single_nested.name}:
get:
tags:
Expand Down Expand Up @@ -690,7 +690,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v1/example/a_bit_of_everything/params/post/{string_value}:
post:
tags:
Expand Down Expand Up @@ -729,7 +729,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v1/example/a_bit_of_everything/query/{uuid}:
get:
tags:
Expand Down Expand Up @@ -1030,7 +1030,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
security: []
externalDocs:
description: "Find out more about GetQuery"
Expand Down Expand Up @@ -1188,7 +1188,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v1/example/a_bit_of_everything/{single_nested.name}:
post:
tags:
Expand Down Expand Up @@ -1228,7 +1228,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v1/example/a_bit_of_everything/{uuid}:
get:
tags:
Expand Down Expand Up @@ -1261,7 +1261,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
put:
tags:
- "ABitOfEverythingService"
Expand Down Expand Up @@ -1298,7 +1298,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
delete:
tags:
- "ABitOfEverythingService"
Expand Down Expand Up @@ -1329,7 +1329,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
security:
- ApiKeyAuth: []
OAuth2:
Expand Down Expand Up @@ -1526,7 +1526,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v2/example/a_bit_of_everything/{abe.uuid}:
put:
tags:
Expand Down Expand Up @@ -1564,7 +1564,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
patch:
tags:
- "ABitOfEverythingService"
Expand Down Expand Up @@ -1601,7 +1601,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v2/example/echo:
get:
tags:
Expand Down Expand Up @@ -1644,7 +1644,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
externalDocs:
description: "Find out more Echo"
url: "https://github.com/grpc-ecosystem/grpc-gateway"
Expand Down Expand Up @@ -1689,7 +1689,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
externalDocs:
description: "Find out more Echo"
url: "https://github.com/grpc-ecosystem/grpc-gateway"
Expand Down Expand Up @@ -1719,7 +1719,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v2/example/errorwithdetails:
get:
tags:
Expand All @@ -1746,7 +1746,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v2/example/overwriteresponsecontenttype:
get:
tags:
Expand Down Expand Up @@ -1776,7 +1776,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v2/example/postwithemptybody/{name}:
post:
tags:
Expand Down Expand Up @@ -1814,7 +1814,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v2/example/timeout:
get:
tags:
Expand All @@ -1841,7 +1841,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v2/example/withbody/{id}:
post:
tags:
Expand Down Expand Up @@ -1879,7 +1879,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
/v2a/example/a_bit_of_everything/{abe.uuid}:
patch:
tags:
Expand Down Expand Up @@ -1917,7 +1917,7 @@ paths:
default:
description: "An unexpected error response"
schema:
$ref: "#/definitions/runtimeError"
$ref: "#/definitions/rpcStatus"
securityDefinitions:
ApiKeyAuth:
type: "apiKey"
Expand Down Expand Up @@ -2369,11 +2369,9 @@ definitions:
\ API method which has a FieldMask type field in the\nrequest should verify\
\ the included field paths, and return an\n`INVALID_ARGUMENT` error if any path\
\ is duplicated or unmappable."
runtimeError:
rpcStatus:
type: "object"
properties:
error:
type: "string"
code:
type: "integer"
format: "int32"
Expand Down
38 changes: 19 additions & 19 deletions examples/internal/clients/abe/api_a_bit_of_everything_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCheckGetQuery
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -625,7 +625,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCheckNestedEn
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -773,7 +773,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCheckPostQuer
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -955,7 +955,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCreate(ctx co
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -1101,7 +1101,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCreateBody(ct
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -1249,7 +1249,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceDeepPathEcho(
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -1394,7 +1394,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceDelete(ctx co
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -1537,7 +1537,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceErrorWithDeta
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -1685,7 +1685,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceGetMessageWit
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -1984,7 +1984,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceGetQuery(ctx
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -2207,7 +2207,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceGetRepeatedQu
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -2352,7 +2352,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceLookup(ctx co
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -2495,7 +2495,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceOverwriteResp
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -2643,7 +2643,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServicePostWithEmpty
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -2786,7 +2786,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceTimeout(ctx c
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -2934,7 +2934,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdate(ctx co
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -3082,7 +3082,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV2(ctx
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -3230,7 +3230,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV22(ctx
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down Expand Up @@ -3378,7 +3378,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV23(ctx
}

if localVarHttpResponse.StatusCode == 0 {
var v RuntimeError
var v RpcStatus
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
Expand Down
Loading