问题
I need send rich structured error details on gRPC error.
I think it's maybe like this:
fv = BadRequest.FieldViolation(field="login", description="Name is not unique")
bad_request = BadRequest(field_violations=[fv])
context.abort(StatusCode.INVALID_ARGUMENT, bad_request.SerializeToString())
But is's wrong and send bytes in summary error text.
I use grpcio==1.17.1
回答1:
I got feedback on github issue https://github.com/grpc/grpc/issues/17601
Everything works in version 1.18.0
来源:https://stackoverflow.com/questions/53781871/how-to-send-error-details-like-as-badrequest