unplugged-system/external/grpc-grpc/examples/ruby/errors_and_cancellation
2025-10-06 13:59:42 +00:00
..
error_examples_client.rb Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
error_examples_server.rb Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
README.md Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00

Errors and Cancelletion code samples for grpc-ruby

The examples in this directory show use of grpc errors.

On the server side, errors are returned from service implementations by raising a certain GRPC::BadStatus exception.

On the client side, GRPC errors get raised when either:

  • the call completes (unary and client-streaming call types)
  • the response Enumerable is iterated through (server-streaming and bidi call types).

To run the examples here:

Start the server:

> ruby error_examples_server.rb

Then run the client:

> ruby error_examples_client.rb