Exception: Kentaa::Api::RequestError

Inherits:
Exception
  • Object
show all
Defined in:
lib/kentaa/api/exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ RequestError

Returns a new instance of RequestError.



11
12
13
14
# File 'lib/kentaa/api/exception.rb', line 11

def initialize(response)
  @response = response
  super()
end

Instance Attribute Details

#responseObject

Returns the value of attribute response.



9
10
11
# File 'lib/kentaa/api/exception.rb', line 9

def response
  @response
end

Instance Method Details

#errorsObject



16
17
18
# File 'lib/kentaa/api/exception.rb', line 16

def errors
  response.errors
end

#http_codeObject



20
21
22
# File 'lib/kentaa/api/exception.rb', line 20

def http_code
  response.http_code
end

#to_sObject



24
25
26
# File 'lib/kentaa/api/exception.rb', line 24

def to_s
  "#{response.http_code}: #{response.message}"
end