Exception: Kokkai::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Kokkai::Error
- Defined in:
- lib/kokkai/error.rb
Constant Summary collapse
- ClientError =
Class.new(self)
- BadRequest =
Class.new(ClientError)
- ERRORS =
{ 400 => Kokkai::Error::BadRequest }.freeze
- ATTRIBUTES =
%w(data diagnostics diagnostic)
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, code) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, code) ⇒ Error
Returns a new instance of Error.
39 40 41 42 |
# File 'lib/kokkai/error.rb', line 39 def initialize(, code) super() @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/kokkai/error.rb', line 3 def code @code end |
Class Method Details
.from_response(body) ⇒ Object
15 16 17 18 |
# File 'lib/kokkai/error.rb', line 15 def from_response(body) , code = parse_error(body) new(, code) end |