Class: KubeMQ::Interceptors::ErrorMappingInterceptor Private
- Inherits:
-
GRPC::ClientInterceptor
- Object
- GRPC::ClientInterceptor
- KubeMQ::Interceptors::ErrorMappingInterceptor
- Defined in:
- lib/kubemq/interceptors/error_mapping_interceptor.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
gRPC client interceptor that catches GRPC::BadStatus exceptions and
converts them to typed Error subclasses via ErrorMapper.
Wraps all four RPC patterns (unary, server-stream, client-stream, bidi-stream) so application code can rescue SDK error types rather than raw gRPC exceptions.
Constant Summary collapse
- GRPC_MAPPING =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Imported gRPC-to-SDK error mapping table.
ErrorMapper::GRPC_MAPPING
Instance Method Summary collapse
-
#bidi_streamer(requests:, call:, method:, metadata:, &block) ⇒ Enumerator
private
Bidirectional response stream.
-
#client_streamer(requests:, call:, method:, metadata:, &block) ⇒ Object
private
The RPC response.
-
#request_response(request:, call:, method:, metadata:, &block) ⇒ Object
private
The RPC response.
-
#server_streamer(request:, call:, method:, metadata:, &block) ⇒ Enumerator
private
Server response stream.
Instance Method Details
#bidi_streamer(requests:, call:, method:, metadata:, &block) ⇒ Enumerator
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns bidirectional response stream.
58 59 60 |
# File 'lib/kubemq/interceptors/error_mapping_interceptor.rb', line 58 def bidi_streamer(requests:, call:, method:, metadata:, &block) map_errors(method) { block.call(requests, call, method, ) } end |
#client_streamer(requests:, call:, method:, metadata:, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the RPC response.
48 49 50 |
# File 'lib/kubemq/interceptors/error_mapping_interceptor.rb', line 48 def client_streamer(requests:, call:, method:, metadata:, &block) map_errors(method) { block.call(requests, call, method, ) } end |
#request_response(request:, call:, method:, metadata:, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the RPC response.
28 29 30 |
# File 'lib/kubemq/interceptors/error_mapping_interceptor.rb', line 28 def request_response(request:, call:, method:, metadata:, &block) map_errors(method) { block.call(request, call, method, ) } end |
#server_streamer(request:, call:, method:, metadata:, &block) ⇒ Enumerator
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns server response stream.
38 39 40 |
# File 'lib/kubemq/interceptors/error_mapping_interceptor.rb', line 38 def server_streamer(request:, call:, method:, metadata:, &block) map_errors(method) { block.call(request, call, method, ) } end |