Exception: Ferto::ResponseError

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

Overview

A custom error class for 40X and 50X responses

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(err, response = nil) ⇒ ResponseError

Initialize a Ferto::ResponseError

Parameters:

  • err (String)

    A string describing the error occured

  • response (Curl::Easy | nil) (defaults to: nil)

    a Curl::Easy object that represents the response returned by the download method. Default: nil



29
30
31
32
# File 'lib/ferto.rb', line 29

def initialize(err, response=nil)
  super(err)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

response is set, during the download in case of 40X or 50X responses are returned, so that it can be used in case of debugging but it is also included for reasons of completeness.



38
39
40
# File 'lib/ferto.rb', line 38

def response
  @response
end