Skip to content

Commit a8d9a5c

Browse files
committed
Print exceptions if needed
1 parent 7538b3d commit a8d9a5c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/msf/core/exploit/http/client.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,12 @@ def send_request_raw(opts={}, timeout = 20)
329329
res = c.send_recv(r, actual_timeout)
330330
print_line(res.to_s) if datastore['HttpTrace']
331331
res
332-
rescue ::Errno::EPIPE, ::Timeout::Error
332+
rescue ::Errno::EPIPE, ::Timeout::Error => e
333+
print_line(e.message) if datastore['HttpTrace']
333334
nil
335+
rescue ::Exception => e
336+
print_line(e) if datastore['HttpTrace']
337+
raise e
334338
end
335339
end
336340

@@ -354,8 +358,12 @@ def send_request_cgi(opts={}, timeout = 20)
354358
res = c.send_recv(r, actual_timeout)
355359
print_line(res.to_s) if datastore['HttpTrace']
356360
res
357-
rescue ::Errno::EPIPE, ::Timeout::Error
361+
rescue ::Errno::EPIPE, ::Timeout::Error => e
362+
print_line(e.message) if datastore['HttpTrace']
358363
nil
364+
rescue ::Exception => e
365+
print_line(e) if datastore['HttpTrace']
366+
raise e
359367
end
360368
end
361369

0 commit comments

Comments
 (0)