Exception: JRPC::Errors::ServerError
- Defined in:
- lib/jrpc/errors.rb
Overview
A JSON-RPC error object the peer sent back, carrying its code and its optional
data member verbatim. Per the spec data is "a primitive or structured value"
defined by the server, so it arrives as whatever JSON.parse produced — String,
Hash, Array, Numeric — or nil when the peer omitted it.
Direct Known Subclasses
InternalError, InternalServerError, InvalidParams, InvalidRequest, MalformedResponseError, MethodNotFound, ParseError, UnknownError
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(message, code: nil, data: nil) ⇒ ServerError
constructor
A new instance of ServerError.
Constructor Details
#initialize(message, code: nil, data: nil) ⇒ ServerError
Returns a new instance of ServerError.
21 22 23 24 25 |
# File 'lib/jrpc/errors.rb', line 21 def initialize(, code: nil, data: nil) @code = code @data = data super() end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
19 20 21 |
# File 'lib/jrpc/errors.rb', line 19 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
19 20 21 |
# File 'lib/jrpc/errors.rb', line 19 def data @data end |