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 hostname 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
[String]
Text 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
27 28 29 30 31 |
# File 'lib/net/tcp_client/exceptions.rb', line 27 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
15 16 17 |
# File 'lib/net/tcp_client/exceptions.rb', line 15 def cause @cause end |
#server ⇒ Object (readonly)
Returns the hostname and port against which the connection failure occurred
11 12 13 |
# File 'lib/net/tcp_client/exceptions.rb', line 11 def server @server end |