Adds example links to the error handling guide (#1247)

This commit is contained in:
Terry Wilson 2024-01-12 12:51:43 -08:00 committed by GitHub
parent 8ee355da8d
commit c11efedde4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 4 deletions

View File

@ -105,9 +105,32 @@ Invalid host set in authority metadata | `GRPC_STATUS_UNAUTHENTICATED`
Error parsing response protocol buffer | `GRPC_STATUS_INTERNAL`
Error parsing request protocol buffer | `GRPC_STATUS_INTERNAL`
### Sample code
### Language Support
Examples code is avilable for multiple languages on how to deal with standard
errors as well as with the richer error details.
| Language | Example |
|----------|--------------------------------|
| C++ | [C++ error handling example] |
| | [C++ error details example] |
| Go | [Go error handling example] |
| | [Go error details example] |
| Java | [Java error handling example] |
| | [Java error details example] |
| Node | [Node error handling example] |
| Python | [Python error details example] |
The [grpc-errors] repo also contains additional error handling examples.
[C++ error handling example]: https://github.com/grpc/grpc/tree/master/examples/cpp/error_handling
[C++ error details example]: https://github.com/grpc/grpc/tree/master/examples/cpp/error_details
[Go error handling example]: https://github.com/grpc/grpc-go/tree/master/examples/features/error_handling
[Go error details example]: https://github.com/grpc/grpc-go/tree/master/examples/features/error_details
[Java error handling example]: https://github.com/grpc/grpc-java/tree/master/examples/src/main/java/io/grpc/examples/errorhandling
[Java error details example]: https://github.com/grpc/grpc-java/tree/master/examples/src/main/java/io/grpc/examples/errordetails
[Node error handling example]: https://github.com/grpc/grpc-node/tree/master/examples/error_handling
[Python error details example]: https://github.com/grpc/grpc/tree/master/examples/python/errors
[grpc-errors]: https://github.com/avinassh/grpc-errors
For sample code illustrating how to handle various gRPC errors, see the
[grpc-errors][] repo.
[grpc-errors]: https://github.com/avinassh/grpc-errors