Exception: KpApi::ApiError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/kp_api/api_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, data) ⇒ ApiError

Returns a new instance of ApiError.



4
5
6
7
# File 'lib/kp_api/api_error.rb', line 4

def initialize(message, data)
  super(message)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



8
9
10
# File 'lib/kp_api/api_error.rb', line 8

def data
  @data
end

Instance Method Details

#bodyObject



14
15
16
# File 'lib/kp_api/api_error.rb', line 14

def body
  @data[:body]
end

#codeObject



10
11
12
# File 'lib/kp_api/api_error.rb', line 10

def code
  @data[:code]
end