Sha256: 14a8706e3c6e882ab10d3c9b96bfbeb851cf4d20d5f58a4d1bc7e55c766ed11f

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

module Net
  class TCPClient
    class ConnectionTimeout < ::SocketError
    end

    class ReadTimeout < ::SocketError
    end

    class WriteTimeout < ::SocketError
    end

    # Raised by ResilientSocket whenever a Socket connection failure has occurred
    class ConnectionFailure < ::SocketError
      # Returns the host name 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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
net_tcp_client-2.2.1 lib/net/tcp_client/exceptions.rb