Class: Rightscale::FlexiscaleConnectionHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/api/right_flexiscale_api.rb

Overview

Simple connection errors handler

Constant Summary collapse

HTTP_CONNECTION_RETRY_COUNT =

Number of times to retry the request after encountering the first error

3
HTTP_CONNECTION_RETRY_DELAY =

Length of the post-error probationary period during which all requests will fail

15
@@params =
{ :http_connection_retry_count => HTTP_CONNECTION_RETRY_COUNT,
  :http_connection_retry_delay => HTTP_CONNECTION_RETRY_DELAY,
  :exception                   => FlexiscaleError,
  :retriable_errors            => [ 'Timeout::Error',
                                    'Errno::ECONNREFUSED', 
                                    'Errno::ETIMEDOUT', 
                                    'OpenSSL::SSL::SSLError',
                                    'SocketError' ],
  :relogin_on_errors           => [ 'InvalidCredentials',
                                    'Your credentials are unsuitable or missing']
}

Class Method Summary collapse

Class Method Details

.paramsObject

Params accessor:

Rightscale::FlexiscaleConnectionHandler.params[:http_connection_retry_count] = 5
Rightscale::FlexiscaleConnectionHandler.params[:retriable_errors] << 'MyAwesomeExceptionClassName'


64
65
66
# File 'lib/api/right_flexiscale_api.rb', line 64

def self.params
  @@params
end