Merge pull request #23 from adfoster-r7/update-json-rpc-process-request-error-handling

Update json rpc process request error handling
This commit is contained in:
Brent Cook
2020-07-21 16:21:14 -05:00
committed by GitHub
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ module Auxiliary
unless mod.has_check?
# Bail out early if the module doesn't have check
raise Msf::ValidationError, Msf::Exploit::CheckCode::Unsupported.message
raise ::NoMethodError.new(Msf::Exploit::CheckCode::Unsupported.message, 'check')
end
# Validate the option container state so that options will
+1 -1
View File
@@ -186,7 +186,7 @@ module Exploit
unless mod.has_check?
# Bail out early if the module doesn't have check
raise Msf::ValidationError, Msf::Exploit::CheckCode::Unsupported.message
raise ::NoMethodError.new(Msf::Exploit::CheckCode::Unsupported.message, 'check')
end
# Validate the option container state so that options will
+5 -1
View File
@@ -111,6 +111,10 @@ module Msf::RPC::JSON
end
response
rescue Msf::OptionValidateError => e
raise InvalidParams.new(data: { options: e.options, message: e.message })
rescue ::NoMethodError => e
raise MethodNotFound.new(e.name, data: { method: e.name, message: e.message })
rescue ArgumentError
raise InvalidParams.new
rescue Msf::RPC::Exception => e
@@ -213,4 +217,4 @@ module Msf::RPC::JSON
end
end
end
end
end