Class: Net::TCPClient::ConnectionFailure
- Inherits:
-
SocketError
- Object
- SocketError
- Net::TCPClient::ConnectionFailure
- Defined in:
- lib/net/tcp_client/exceptions.rb
Overview
Raised by ResilientSocket whenever a Socket connection failure has occurred
Instance Attribute Summary collapse
-
#cause ⇒ Object
readonly
Returns the original exception that caused the connection failure For example instances of Errno::ECONNRESET.
-
#server ⇒ Object
readonly
Returns the host name and port against which the connection failure occurred.
Instance Method Summary collapse
-
#initialize(message, server, cause = nil) ⇒ ConnectionFailure
constructor
Parameters message [String] Text message of the reason for the failure and/or where it occurred.
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(, server, cause = nil) @server = server @cause = cause super() end |
Instance Attribute Details
#cause ⇒ Object (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 |
#server ⇒ Object (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 |