Skip to content

Commit 173705a

Browse files
committed
Add error handling when no data returned from server
1 parent 16cdf1c commit 173705a

File tree

1 file changed

+5
-0
lines changed
  • lib/metasploit/framework/data_service/remote/http

1 file changed

+5
-0
lines changed

lib/metasploit/framework/data_service/remote/http/core.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ def make_request(request_type, path, data_hash = nil)
9595
puts "HTTP #{request_type} request: #{path} failed with code: #{response.code} message: #{response.body}"
9696
return FailedResponse.new(response)
9797
end
98+
rescue EOFError => e
99+
puts "ERROR: No data was returned from the server."
100+
puts "Backtrace: #{e.message}"
101+
e.backtrace.each { |line| puts "#{line}\n"}
102+
return FailedResponse.new("")
98103
rescue Exception => e
99104
puts "Problem with HTTP #{request_type} request: #{e.message}"
100105
e.backtrace.each { |line| puts "#{line}\n" }

0 commit comments

Comments
 (0)