Skip to content

examples: Added README files for all missing Examples #11676

New issue

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

Merged
merged 23 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8e3d26c
examples: following the consistency for example-alts directory structure
vinodhabib Nov 8, 2024
273fd93
examples: added the missing examples to common readme file
vinodhabib Nov 8, 2024
cfd8e5b
examples: Updated common readme file
vinodhabib Nov 11, 2024
d623eaa
examples: Fixed review points
vinodhabib Nov 12, 2024
3de4103
examples: Added README file with details for examples
vinodhabib Nov 19, 2024
886ab3d
examples: Added README file with details for examples
vinodhabib Nov 20, 2024
817955e
examples: Added README file with details for examples
vinodhabib Nov 21, 2024
3aea455
examples: Added README file with details for examples
vinodhabib Nov 21, 2024
8ce4eeb
examples: Added README file with details for examples
vinodhabib Nov 21, 2024
5d3620f
examples: Added README file with details for examples
vinodhabib Nov 22, 2024
e733bf8
examples: Removed extra lines in the Readme files of Examples
vinodhabib Nov 22, 2024
db40f63
examples: Added README file with details for examples
vinodhabib Nov 22, 2024
cc6f318
examples: Added README file with details for examples
vinodhabib Nov 22, 2024
b05c638
examples: Added README file with details for examples
vinodhabib Nov 25, 2024
e60dfda
examples: Added README file with details for examples
vinodhabib Nov 25, 2024
dd772a2
examples: Added README file with details for examples
vinodhabib Nov 25, 2024
23235be
examples: Added README file with details for examples
vinodhabib Nov 26, 2024
bed79d0
examples: Added README file with details for examples
vinodhabib Nov 26, 2024
3aa4e2e
examples: Added README file with details for examples
vinodhabib Nov 27, 2024
e15579f
Merge branch 'master' into defect-5467-example-doc-changes
vinodhabib Jan 7, 2025
57a3168
examples: Fixed some Review points and others in progress
vinodhabib Jan 7, 2025
cccde3c
examples: Fixed all Review points
vinodhabib Jan 8, 2025
9f5edea
examples: Fixed the recent review points
vinodhabib Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
examples: Added README file with details for examples
  • Loading branch information
vinodhabib committed Nov 21, 2024
commit 8ce4eebcef5f32ec83ac91d78e8589cd8dcbcb28
17 changes: 17 additions & 0 deletions examples/src/main/java/io/grpc/examples/errordetails/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
gRPC Error Details Example
=====================

If a gRPC call completes successfully the server returns an OK status to the client (depending on the language the OK status may or may not be directly used in your code).
But what happens if the call isn’t successful?

This Example gives the usage and implementation of how return the error details if gRPC call not successful or fails
and how to set and read com.google.rpc.Status objects as google.rpc.Status error details.

gRPC allows detailed error information to be encapsulated in protobuf messages, which are sent alongside the status codes.

If an error occurs, gRPC returns one of its error status codes with error message that provides further error details about what happened.

You can refer the below links for more details on error details and status codes
- https://grpc.io/docs/guides/error/
- https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/Status.java

28 changes: 28 additions & 0 deletions examples/src/main/java/io/grpc/examples/errorhandling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
gRPC Error Handling Example
=====================

Error handling in gRPC is a critical aspect of designing reliable and robust distributed systems.
gRPC provides a standardized mechanism for handling errors using status codes, error details, and optional metadata.

This Example gives the usage and implementation of how to handle the Errors/Exceptions in gRPC,
shows how to extract error information from a failed RPC and setting and reading RPC error details.

If a gRPC call completes successfully the server returns an OK status to the client (depending on the language the OK status may or may not be directly used in your code).

If an error occurs gRPC returns one of its error status codes with error message that provides further error details about what happened.

Error Propagation:
- When an error occurs on the server, gRPC stops processing the RPC and sends the error (status code, description, and optional details) to the client.
- On the client side, the error can be handled based on the status code.

Client Side Error Handling:
- The gRPC client typically throws an exception or returns an error object when an RPC fails.

Server Side Error Handling:
- Servers use the gRPC API to return errors explicitly using the grpc library's status functions.

gRPC uses predefined status codes to represent the outcome of an RPC call. These status codes are part of the Status object that is sent from the server to the client.
Each status code is accompanied by a human-readable description(Please refer https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/Status.java)

You can refer the gRPC documentation for more details on Error Handling https://grpc.io/docs/guides/error/