Class: Net::TCPClient::ConnectionFailure

Inherits:
SocketError
  • Object
show all
Defined in:
lib/net/tcp_client/exceptions.rb

Overview

Raised by ResilientSocket whenever a Socket connection failure has occurred

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, server, cause = nil) ⇒ ConnectionFailure

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


31
32
33
34
35
# File 'lib/net/tcp_client/exceptions.rb', line 31

def initialize(message, server, cause = nil)
  @server = server
  @cause  = cause
  super(message)
end

Instance Attribute Details

#causeObject (readonly)

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



19
20
21
# File 'lib/net/tcp_client/exceptions.rb', line 19

def cause
  @cause
end

#serverObject (readonly)

Returns the host name and port against which the connection failure occurred



15
16
17
# File 'lib/net/tcp_client/exceptions.rb', line 15

def server
  @server
end