Skip to content

Commit 25f2241

Browse files
author
Brent Cook
committed
Land rapid7#6246, show the user errors from create_session
2 parents 674f58b + a78fa7c commit 25f2241

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/msf/core/handler.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,14 @@ def create_session(conn, opts={})
189189
# If the payload we merged in with has an associated session factory,
190190
# allocate a new session.
191191
if (self.session)
192-
s = self.session.new(conn, opts)
192+
begin
193+
s = self.session.new(conn, opts)
194+
rescue ::Exception => e
195+
# We just wanna show and log the error, not trying to swallow it.
196+
print_error("#{e.class} #{e.message}")
197+
elog("#{e.class} #{e.message}\n#{e.backtrace * "\n"}")
198+
raise e
199+
end
193200

194201
# Pass along the framework context
195202
s.framework = framework

0 commit comments

Comments
 (0)