Adjusting exception handling
This commit adjusts the error handling to close the socket before calling fail_with and adds specific exceptions to catchbug/bundler_fix
parent
32ae3e881e
commit
4b23d2dc58
|
@ -128,9 +128,9 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
end
|
||||
|
||||
handler(sock)
|
||||
rescue
|
||||
fail_with(Failure::Unknown, "Unknown error")
|
||||
sock.close
|
||||
rescue Rex::AddressInUse, ::Errno::ETIMEDOUT, Rex::HostUnreachable, Rex::ConnectionTimeout, Rex::ConnectionRefused, ::Timeout::Error, ::EOFError => e
|
||||
sock.close if sock
|
||||
fail_with(Failure::Unknown, e.message)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue