Comments (4)
Hey!
So, gRPC docs finally added few more details on rich error handling - https://grpc.io/docs/guides/error/#richer-error-model
According to the docs:
This richer error model is already supported in the C++, Go, Java, Python, and Ruby libraries, and at least the grpc-web and Node.js libraries have open issues requesting it.
I have started working on and opened a PR - #15
I have added Go and Python examples for now and other language examples later. If anyone interested doing same for C++, Java or Ruby, please let me know. Thank you!
from grpc-errors.
Does only Go supports this? I can't seem to find much details for other languages.
from grpc-errors.
+1 for client\server examples of handling details
In Java it is also supported this via:
Status s = com.google.rpc.Status.newBuilder()
.setCode(com.google.rpc.Code.INVALID_ARGUMENT.getNumber())
.setMessage("Invalid age")
.addDetails(Any.pack(BadRequest.newBuilder()
.addFieldViolations(BadRequest.FieldViolation
.newBuilder()
.setField("age")
.setDescription("age must be positive ")
.build()
).build()
)
).build();
throw io.grpc.protobuf.StatusProto.toStatusRuntimeException(s);
from grpc-errors.
Yes, I would like this for C#, it's really hard to figure out. I guess google.rpc.Status should be inserted in trailers, and embedding e.g. google.rpc.BadRequest inside that.
But no examples anywhere.
I think google.rpc.BadRequest with field violations is so fundamental error type that example of it's usage should be shown.
from grpc-errors.
Related Issues (14)
- PHP implementation HOT 1
- Kotlin implementation
- Add examples of server error interceptors for Java and Kotlin HOT 1
- Add examples for streaming situations HOT 5
- is it possible to have a server in c++ on Linux and remote client in C# on Windows for gRPC HOT 1
- which version of openssl does the current grpc work with HOT 1
- Replacing gRPC.Core with gRPC.Dotnet
- Is it possible to extract extended gRPC details from Python exception? HOT 1
- How to detect external runtime_error message by gRPC server and pass to client HOT 2
- Where are Java and Kotlin Examples? HOT 3
- Java implementation HOT 4
- Go example: grpc.Errorf is deprecated, use status.Errorf instead HOT 1
- Node Streaming Error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpc-errors.