Exception: Protobuf::Rpc::PbError
- Inherits:
-
StandardError
- Object
- StandardError
- Protobuf::Rpc::PbError
- Defined in:
- lib/protobuf/rpc/error.rb
Overview
Base PbError class for client and server errors
Direct Known Subclasses
BadRequestData, BadRequestProto, BadResponseProto, IOError, InvalidRequestProto, MethodNotFound, RpcError, RpcFailed, ServiceNotFound, UnkownHost
Instance Attribute Summary collapse
-
#error_type ⇒ Object
readonly
Returns the value of attribute error_type.
Instance Method Summary collapse
-
#initialize(message = 'An unknown RpcError occurred', error_type = 'RPC_ERROR') ⇒ PbError
constructor
A new instance of PbError.
- #to_response(response) ⇒ Object
Constructor Details
#initialize(message = 'An unknown RpcError occurred', error_type = 'RPC_ERROR') ⇒ PbError
Returns a new instance of PbError.
11 12 13 14 |
# File 'lib/protobuf/rpc/error.rb', line 11 def initialize ='An unknown RpcError occurred', error_type='RPC_ERROR' @error_type = error_type.is_a?(String) ? Protobuf::Socketrpc::ErrorReason.const_get(error_type) : error_type super end |
Instance Attribute Details
#error_type ⇒ Object (readonly)
Returns the value of attribute error_type.
9 10 11 |
# File 'lib/protobuf/rpc/error.rb', line 9 def error_type @error_type end |
Instance Method Details
#to_response(response) ⇒ Object
16 17 18 19 |
# File 'lib/protobuf/rpc/error.rb', line 16 def to_response response response.error = response.error_reason = @error_type end |