Exception: SOCKSError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/socksify.rb

Defined Under Namespace

Classes: AddressTypeNotSupported, CommandNotSupported, ConnectionRefused, HostUnreachable, NetworkUnreachable, NotAllowed, ServerFailure, TTLExpired

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg) ⇒ SOCKSError

Returns a new instance of SOCKSError.


24
25
26
27
# File 'lib/socksify.rb', line 24

def initialize(msg)
  Socksify::debug_error("#{self.class}: #{msg}")
  super
end

Class Method Details

.for_response_code(code) ⇒ Object


70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/socksify.rb', line 70

def self.for_response_code(code)
  case code
  when 1
    ServerFailure
  when 2
    NotAllowed
  when 3
    NetworkUnreachable
  when 4
    HostUnreachable
  when 5
    ConnectionRefused
  when 6
    TTLExpired
  when 7
    CommandNotSupported
  when 8
    AddressTypeNotSupported
  else
    self
  end
end