spacewander commented on issue #6996:
URL: https://github.com/apache/apisix/issues/6996#issuecomment-1185239649

   > `grpc-status-details-bin` is encoded with marshalling followed by base64, 
we need the proto to unmarshall. I have no idea how to upload proto file, and 
decode it with lua.
   > 
   > Here is my test code
   > 
   > ```
   > message ErrorDetail {
   >     int64 code = 1;
   >     string message = 2;
   >     string type = 3;
   > }
   > 
   > // GetErrResp implements helloworld.GreeterServer
   > func (s *server) GetErrResp(ctx context.Context, in *pb.HelloRequest) 
(*pb.HelloReply, error) {
   >     st := status.New(codes.Unavailable, "Out of service")
   >     st, err := st.WithDetails(&pb.ErrorDetail{
   >         Code:             1,
   >         Message:       "The server is out of service",
   >    Type:          "service",
   >     })
   > 
   >     if err != nil {
   >    panic(fmt.Sprintf("Unexpected error attaching metadata: %v", err))
   >     }
   > 
   >     return nil, st.Err()
   > }
   > 
   > === TEST 3: hit route
   > --- request
   > GET /grpctest?name=world
   > --- response_headers
   > grpc-status: 14
   > grpc-message: Out of service
   > grpc-status-details-bin: 
CA4SDk91dCBvZiBzZXJ2aWNlGlcKKnR5cGUuZ29vZ2xlYXBpcy5jb20vaGVsbG93b3JsZC5FcnJvckRldGFpbBIpCAESHFRoZSBzZXJ2ZXIgaXMgb3V0IG9mIHNlcnZpY2UaB3NlcnZpY2U
   > --- no_error_log
   > [error]
   > --- error_code: 503
   > ```
   
   Put it under 
https://github.com/apache/apisix/tree/master/apisix/include/apisix/model


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to