Browse Source

Print exceptions if needed

wchen-r7 3 years ago
parent
commit
a8d9a5c02c
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      lib/msf/core/exploit/http/client.rb

+ 10
- 2
lib/msf/core/exploit/http/client.rb View File

@@ -329,8 +329,12 @@ module Exploit::Remote::HttpClient
329 329
       res = c.send_recv(r, actual_timeout)
330 330
       print_line(res.to_s) if datastore['HttpTrace']
331 331
       res
332
-    rescue ::Errno::EPIPE, ::Timeout::Error
332
+    rescue ::Errno::EPIPE, ::Timeout::Error => e
333
+      print_line(e.message) if datastore['HttpTrace']
333 334
       nil
335
+    rescue ::Exception => e
336
+      print_line(e) if datastore['HttpTrace']
337
+      raise e
334 338
     end
335 339
   end
336 340
 
@@ -354,8 +358,12 @@ module Exploit::Remote::HttpClient
354 358
       res = c.send_recv(r, actual_timeout)
355 359
       print_line(res.to_s) if datastore['HttpTrace']
356 360
       res
357
-    rescue ::Errno::EPIPE, ::Timeout::Error
361
+    rescue ::Errno::EPIPE, ::Timeout::Error => e
362
+      print_line(e.message) if datastore['HttpTrace']
358 363
       nil
364
+    rescue ::Exception => e
365
+      print_line(e) if datastore['HttpTrace']
366
+      raise e
359 367
     end
360 368
   end
361 369
 

Loading…
Cancel
Save