Exception: Net::SSH::ChannelOpenFailed

Inherits:
Exception
  • Object
show all
Defined in:
lib/net/ssh/errors.rb

Overview

This is exception is primarily used internally, but if you have a channel open handler (see Net::SSH::Connection::Session#on_open_channel) and you want to fail in such a way that the server knows it failed, you can raise this exception in the handler and Net::SSH will translate that into a “channel open failed” message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, reason) ⇒ ChannelOpenFailed

Returns a new instance of ChannelOpenFailed.


36
37
38
39
# File 'lib/net/ssh/errors.rb', line 36

def initialize(code, reason)
  @code, @reason = code, reason
  super "#{reason} (#{code})"
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code


34
35
36
# File 'lib/net/ssh/errors.rb', line 34

def code
  @code
end

#reasonObject (readonly)

Returns the value of attribute reason


34
35
36
# File 'lib/net/ssh/errors.rb', line 34

def reason
  @reason
end