Exception: Redd::Errors::ResponseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/redd/errors.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.


33
34
35
36
# File 'lib/redd/errors.rb', line 33

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


31
32
33
# File 'lib/redd/errors.rb', line 31

def response
  @response
end