Exception: Net::SSH::ChannelOpenFailed
- 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
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
-
#initialize(code, reason) ⇒ ChannelOpenFailed
constructor
A new instance of ChannelOpenFailed.
Constructor Details
#initialize(code, reason) ⇒ ChannelOpenFailed
Returns a new instance of ChannelOpenFailed.
29 30 31 32 |
# File 'lib/net/ssh/errors.rb', line 29 def initialize(code, reason) @code, @reason = code, reason super "#{reason} (#{code})" end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
27 28 29 |
# File 'lib/net/ssh/errors.rb', line 27 def code @code end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
27 28 29 |
# File 'lib/net/ssh/errors.rb', line 27 def reason @reason end |