Skip to content

Commit

Permalink
Merge pull request #138 from mercari/fix-error-type
Browse files Browse the repository at this point in the history
Move Error type definition to grpc/federation/cel package
  • Loading branch information
goccy authored Apr 2, 2024
2 parents 53b12b2 + d24b4e8 commit b97f66a
Show file tree
Hide file tree
Showing 17 changed files with 93 additions and 72 deletions.
2 changes: 1 addition & 1 deletion _examples/04_timeout/grpc/federation/federation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _examples/05_async/grpc/federation/federation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _examples/06_alias/grpc/federation/federation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _examples/09_multi_user/grpc/federation/federation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _examples/10_oneof/grpc/federation/federation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _examples/14_condition/grpc/federation/federation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 43 additions & 42 deletions _examples/17_error_handler/federation/federation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions _examples/17_error_handler/proto/federation/federation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ message Post {
message: "'this is custom error message'"
details {
def { name: "localized_msg" message { name: "LocalizedMessage" args { name: "value" by: "id" } } }
message { name: "CustomMessage" args { name: "msg" by: "id" } }
message { name: "CustomMessage" args { name: "error_info" by: "error" } }
precondition_failure {
violations {
type: "'some-type'"
Expand Down Expand Up @@ -82,5 +82,5 @@ message LocalizedMessage {
}

message CustomMessage {
string msg = 1 [(grpc.federation.field).by = "'custom error message:' + $.msg"];
string msg = 1 [(grpc.federation.field).by = "'custom error message:' + $.error_info.message"];
}
2 changes: 1 addition & 1 deletion grpc/federation/cel.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ func SetGRPCError(ctx context.Context, value localValue, err error) {
if !ok {
return
}
grpcErr := &Error{
grpcErr := &grpcfedcel.Error{
Code: int32(stat.Code()),
Message: stat.Message(),
}
Expand Down
Loading

0 comments on commit b97f66a

Please sign in to comment.