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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user