Class: Ffccmmx::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/ffccmmx/response.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



7
8
9
# File 'lib/ffccmmx/response.rb', line 7

def initialize(response)
  @response = response
end

Instance Method Details

#valueObject



11
12
13
14
15
16
17
18
19
# File 'lib/ffccmmx/response.rb', line 11

def value
  @response.raise_for_status
rescue HTTPX::Error => e
  raise Ffccmmx::HTTPXRetryableError.new(e.response), cause: e if Ffccmmx::HTTPXRetryableError.retryable_error?(e)

  raise Ffccmmx::HTTPXError.new(e.response), cause: e
rescue StandardError => e
  raise Ffccmmx::Error, cause: e
end