Class: Fieldhand::ResponseError

Inherits:
NetworkError
  • Object
show all
Defined in:
lib/fieldhand/network_errors.rb

Overview

Custom exception to handle unexpected HTTP responses

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResponseError

Returns a new instance of ResponseError.



10
11
12
13
14
# File 'lib/fieldhand/network_errors.rb', line 10

def initialize(response)
  super("Invalid response: #{response.code} #{response.msg}")

  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



8
9
10
# File 'lib/fieldhand/network_errors.rb', line 8

def response
  @response
end