aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/ruby/errors_and_cancellation/README.md
blob: 126518c4aab19e7aaf703a728f5f82e5d52954d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#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
```