Class: ResilientSocket::ConnectionFailure

Inherits:
SocketError
  • Object
show all
Defined in:
lib/resilient_socket/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


26
27
28
29
30
# File 'lib/resilient_socket/exceptions.rb', line 26

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



14
15
16
# File 'lib/resilient_socket/exceptions.rb', line 14

def cause
  @cause
end

#serverObject (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