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.



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

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

  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



6
7
8
# File 'lib/fieldhand/network_errors.rb', line 6

def response
  @response
end