Exception: Terminal::APIResponseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/terminal/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ APIResponseError

Returns a new instance of APIResponseError.



8
9
10
11
12
# File 'lib/terminal/errors.rb', line 8

def initialize(response)
  @response = response
  @message = @response.body.nil? ? '' : @response.body['error']
  super(message)
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



7
8
9
# File 'lib/terminal/errors.rb', line 7

def message
  @message
end

#responseObject (readonly)

Returns the value of attribute response.



7
8
9
# File 'lib/terminal/errors.rb', line 7

def response
  @response
end