clarify error handling when a channel cannot be opened
parent
9db2cdb33a
commit
807a27e73d
|
@ -116,15 +116,13 @@ class Channel
|
|||
begin
|
||||
response = client.send_request(request)
|
||||
cid = response.get_tlv_value(TLV_TYPE_CHANNEL_ID)
|
||||
# Handle channel open failure exceptions
|
||||
if cid.nil?
|
||||
raise Rex::Post::Meterpreter::RequestError
|
||||
end
|
||||
end
|
||||
|
||||
if cid
|
||||
# Create the channel instance
|
||||
klass.new(client, cid, type, flags)
|
||||
else
|
||||
raise Rex::ConnectionRefused
|
||||
end
|
||||
# Create the channel instance
|
||||
klass.new(client, cid, type, flags)
|
||||
end
|
||||
|
||||
##
|
||||
|
|
Loading…
Reference in New Issue