Exception: Redd::Errors::APIError

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

Overview

An error with the API.

Direct Known Subclasses

RateLimitError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ APIError

Returns a new instance of APIError.


13
14
15
16
# File 'lib/redd/errors.rb', line 13

def initialize(response)
  @response = response
  super(response.body[:json][:errors][0].join(', '))
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


11
12
13
# File 'lib/redd/errors.rb', line 11

def name
  @name
end

#responseObject (readonly)

Returns the value of attribute response


11
12
13
# File 'lib/redd/errors.rb', line 11

def response
  @response
end