class Net::SSH::Connection::Channel

def on_open_failed(&block)

channel.on_open_failed { |ch, code, desc| ... }

end
# ..
channel = session.open_channel do |ch|

description of the failure from the server.
along with the integer "reason code" for the failure, and a textual
the requested channel. The channel itself will be passed to the block,
Registers a callback to be invoked when the server was unable to open
def on_open_failed(&block)
  old, @on_open_failed = @on_open_failed, block
  old
end