Exception: Acfs::ErroneousResponse

Inherits:
Error
  • Object
show all
Defined in:
lib/acfs/errors.rb

Overview

Response error containing the responsible response object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ ErroneousResponse

Returns a new instance of ErroneousResponse.



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/acfs/errors.rb', line 38

def initialize(opts = {})
  @response = opts[:response]

  message = if response
              (opts[:message] ? "#{opts[:message]}:" : 'Received') +
                " #{response.code} for #{response.request.method.upcase}" \
                " #{response.request.url} #{response.request.format}"
            else
              opts[:message] || 'Received erroneous response'
            end

  super opts, message
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



36
37
38
# File 'lib/acfs/errors.rb', line 36

def response
  @response
end