We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我没找到例子关于如何正确的给返回客户端,错误码和错误信息,这个应该如何弄比较优雅
Status SayHello(ServerContext* context, const HelloRequest* request, HelloReply* reply) override { if (request->name().empty()) { return Status(grpc::StatusCode::INVALID_ARGUMENT, "Name must not be empty"); } reply->set_message("Hello " + request->name()); return Status::OK; } };
The text was updated successfully, but these errors were encountered:
这种情况,我觉得把错误码和错误字符串设计在你的协议里会好一些,因为这是一次正常的通信,没有办法在直接修改我们meta信息里的错误码。
Sorry, something went wrong.
No branches or pull requests
我没找到例子关于如何正确的给返回客户端,错误码和错误信息,这个应该如何弄比较优雅
The text was updated successfully, but these errors were encountered: