Exception: Redd::ResponseError

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

Overview

Represents an error from reddit returned in a response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResponseError

Returns a new instance of ResponseError.



22
23
24
25
# File 'lib/redd/error.rb', line 22

def initialize(response)
  super(response.raw_body.length <= 80 ? response.raw_body : "#{response.raw_body[0..80]}...")
  @response = response
end

Instance Attribute Details

#responseObject

Returns the value of attribute response.



20
21
22
# File 'lib/redd/error.rb', line 20

def response
  @response
end