Skip to content

Commit 785a176

Browse files
committed
Move logging and error printing to the end; return proper status
1 parent 9d67ce0 commit 785a176

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tools/modules/update_payload_cached_sizes.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
# Initialize the simplified framework instance.
2727
framework = Msf::Simple::Framework.create('DisableDatabase' => true)
28-
28+
exceptions = []
2929
framework.payloads.each_module do |name, mod|
3030
begin
3131
next if name =~ /generic/
@@ -35,8 +35,13 @@
3535
$stdout.puts "[*] Updating the CacheSize for #{mod.file_path}..."
3636
Msf::Util::PayloadCachedSize.update_module_cached_size(mod_inst)
3737
rescue => e
38-
print_line("Caught Error while updating #{name}:\n#{e}")
39-
elog(e)
38+
exceptions << [ e, name ]
4039
next
4140
end
42-
end
41+
end
42+
43+
exceptions.each do |e, name|
44+
print_error("Caught Error while updating #{name}:\n#{e}")
45+
elog(e)
46+
end
47+
exit(1) unless exceptions.empty?

0 commit comments

Comments
 (0)