Class: QRPC::Protocol::JsonRpc::Error
- Inherits:
-
Abstract::Error
- Object
- Abstract
- Object
- Abstract::Error
- QRPC::Protocol::JsonRpc::Error
- Defined in:
- lib/qrpc/protocol/json-rpc/error.rb
Overview
JSON-RPC error implementation.
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
-
#native ⇒ JsonRpcObjects::Generic::Error
Returns the native object.
-
#serialize ⇒ String
Serializes object to the resultant form.
Methods inherited from Abstract::Error
Methods inherited from Abstract
#error, #initialize, #request, #response
Constructor Details
This class inherits a constructor from QRPC::Protocol::Abstract::Error
Instance Method Details
#native ⇒ JsonRpcObjects::Generic::Error
Returns the native object.
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/qrpc/protocol/json-rpc/error.rb', line 46 def native if @native.nil? exception = @options.exception request = @options.request data = QRPC::Protocol::JsonRpc::Native::ExceptionData::create(exception) @native = request.native.class::version.error::create(100, "exception raised during processing the request", :error => data.output) @native.serializer = @options.serializer end @native end |
#serialize ⇒ String
Serializes object to the resultant form.
64 65 66 |
# File 'lib/qrpc/protocol/json-rpc/error.rb', line 64 def serialize self.native.serialize end |