Handle multiple exceptions
parent
40188e1eda
commit
9c76e7fb00
|
@ -45,9 +45,15 @@ class Metasploit3 < Msf::Post
|
||||||
if q.nil? or q[:results].empty?
|
if q.nil? or q[:results].empty?
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
rescue RuntimeError => e
|
rescue ::Exception => e
|
||||||
print_error(e.message)
|
if e.kind_of?(RuntimeError) or e.kind_of?(RequestError)
|
||||||
return
|
# Can't bind or in a network w/ limited accounts
|
||||||
|
print_error(e.message)
|
||||||
|
return
|
||||||
|
else
|
||||||
|
# Unexpected, raise it
|
||||||
|
raise $1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Results table holds raw string data
|
# Results table holds raw string data
|
||||||
|
|
Loading…
Reference in New Issue