Exception: Fluence::Gateway::UpstreamUnavailableError

Inherits:
RequestError show all
Defined in:
lib/fluence/gateway/errors.rb

Overview

Raised when the gateway answered 502, 503 or 504: it could not reach the backend, the backend declared itself unavailable, or it did not answer in time. The request itself was fine — safe to retry.

Examples:

Retry once when the backend was unreachable

attempts = 0
begin
  Fluence::Gateway::Client.get('/v2/trading_venues', tenant: :mosaic)
rescue Fluence::Gateway::UpstreamUnavailableError
  raise if (attempts += 1) > 1
  sleep 2
  retry
end

Instance Attribute Summary

Attributes inherited from RequestError

#body, #headers, #status

Method Summary

Methods inherited from RequestError

build, #initialize

Constructor Details

This class inherits a constructor from Fluence::Gateway::RequestError