Exception: Jimson::Server::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Jimson::Server::Error
- Defined in:
- lib/jimson/server/error.rb
Direct Known Subclasses
ApplicationError, InternalError, InvalidParams, InvalidRequest, MethodNotFound, ParseError
Defined Under Namespace
Classes: ApplicationError, InternalError, InvalidParams, InvalidRequest, MethodNotFound, ParseError
Constant Summary collapse
- CODES =
{ -32700 => ParseError, -32600 => InvalidRequest, -32601 => MethodNotFound, -32602 => InvalidParams, -32603 => InternalError }
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(code, message) ⇒ Error
constructor
A new instance of Error.
- #to_h ⇒ Object
Constructor Details
#initialize(code, message) ⇒ Error
Returns a new instance of Error.
6 7 8 9 10 |
# File 'lib/jimson/server/error.rb', line 6 def initialize(code, ) @code = code @message = super() end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
4 5 6 |
# File 'lib/jimson/server/error.rb', line 4 def code @code end |
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/jimson/server/error.rb', line 4 def @message end |
Instance Method Details
#to_h ⇒ Object
12 13 14 15 16 17 |
# File 'lib/jimson/server/error.rb', line 12 def to_h { 'code' => @code, 'message' => @message } end |