Sha256: 992e16d7c93aefa7fd5c25b744fe9b0f2f97b3b5c2f726d220445e771cd8e458

Contents?: true

Size: 937 Bytes

Versions: 6

Compression:

Stored size: 937 Bytes

Contents

require 'socket'
module ResilientSocket

  class ConnectionTimeout < ::SocketError; end
  class ReadTimeout < ::SocketError; end

  # Raised by ResilientSocket whenever a Socket connection failure has occurred
  class ConnectionFailure < ::SocketError
    # Returns the hostname and port against which the connection failure occurred
    attr_reader :server

    # Returns the original exception that caused the connection failure
    # For example instances of Errno::ECONNRESET
    attr_reader :cause

    # Parameters
    #   message [String]
    #     Text message of the reason for the failure and/or where it occurred
    #
    #   server [String]
    #     Hostname and port
    #     For example: "localhost:2000"
    #
    #   cause [Exception]
    #     Original Exception if any, otherwise nil
    def initialize(message, server, cause=nil)
      @server = server
      @cause = cause
      super(message)
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
resilient_socket-0.5.0 lib/resilient_socket/exceptions.rb
resilient_socket-0.4.0 lib/resilient_socket/exceptions.rb
resilient_socket-0.3.2 lib/resilient_socket/exceptions.rb
resilient_socket-0.3.1 lib/resilient_socket/exceptions.rb
resilient_socket-0.3.0 lib/resilient_socket/exceptions.rb
resilient_socket-0.2.0 lib/resilient_socket/exceptions.rb