Class: Grpcx::Server::Interceptors::Rescue
- Inherits:
-
GRPC::ServerInterceptor
- Object
- GRPC::ServerInterceptor
- Grpcx::Server::Interceptors::Rescue
- Defined in:
- lib/grpcx/server/interceptors/rescue.rb
Instance Method Summary collapse
- #bidi_streamer ⇒ Object
- #client_streamer ⇒ Object
-
#initialize(rescuable, opts = {}) ⇒ Rescue
constructor
A new instance of Rescue.
- #request_response ⇒ Object
- #server_streamer ⇒ Object
Constructor Details
#initialize(rescuable, opts = {}) ⇒ Rescue
Returns a new instance of Rescue.
5 6 7 8 |
# File 'lib/grpcx/server/interceptors/rescue.rb', line 5 def initialize(rescuable, opts = {}) @rescuable = rescuable super(opts) end |
Instance Method Details
#bidi_streamer ⇒ Object
28 29 30 31 32 |
# File 'lib/grpcx/server/interceptors/rescue.rb', line 28 def bidi_streamer(*) yield rescue StandardError => e @rescuable.rescue_with_handler(e) || raise end |
#client_streamer ⇒ Object
16 17 18 19 20 |
# File 'lib/grpcx/server/interceptors/rescue.rb', line 16 def client_streamer(*) yield rescue StandardError => e @rescuable.rescue_with_handler(e) || raise end |
#request_response ⇒ Object
10 11 12 13 14 |
# File 'lib/grpcx/server/interceptors/rescue.rb', line 10 def request_response(*) yield rescue StandardError => e @rescuable.rescue_with_handler(e) || raise end |
#server_streamer ⇒ Object
22 23 24 25 26 |
# File 'lib/grpcx/server/interceptors/rescue.rb', line 22 def server_streamer(*) yield rescue StandardError => e @rescuable.rescue_with_handler(e) || raise end |