nicely handle exceptions when processing scripts, tell the user about them
Let's help the user by saying what's going on.MS-2855/keylogger-mettle-extension
parent
05c6079e0d
commit
5ecc45a0d1
|
@ -164,13 +164,17 @@ module Scriptable
|
|||
else
|
||||
full_path = self.class.find_script_path(script_name)
|
||||
|
||||
# No path found? Weak.
|
||||
if full_path.nil?
|
||||
print_error("The specified script could not be found: #{script_name}")
|
||||
return true
|
||||
return
|
||||
end
|
||||
|
||||
begin
|
||||
execute_file(full_path, args)
|
||||
framework.events.on_session_script_run(self, full_path)
|
||||
rescue StandardError => e
|
||||
print_error("Could not execute #{script_name}: #{e.class} #{e}")
|
||||
end
|
||||
framework.events.on_session_script_run(self, full_path)
|
||||
execute_file(full_path, args)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue