Class: ResilientSocket::ConnectionFailure
- Inherits:
-
SocketError
- Object
- SocketError
- ResilientSocket::ConnectionFailure
- Defined in:
- lib/resilient_socket/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
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
26 27 28 29 30 |
# File 'lib/resilient_socket/exceptions.rb', line 26 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
14 15 16 |
# File 'lib/resilient_socket/exceptions.rb', line 14 def cause @cause end |
#server ⇒ Object (readonly)
Returns the hostname and port against which the connection failure occurred
10 11 12 |
# File 'lib/resilient_socket/exceptions.rb', line 10 def server @server end |