From b3642b1079965f2a3153acdff75e7fe5d4af5051 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Tue, 20 Feb 2018 15:30:37 -0600 Subject: [PATCH] Address PR comments --- lib/metasploit/framework/data_service/proxy/core.rb | 2 ++ lib/metasploit/framework/data_service/proxy/nmap_data_proxy.rb | 2 +- lib/metasploit/framework/data_service/proxy/vuln_data_proxy.rb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/metasploit/framework/data_service/proxy/core.rb b/lib/metasploit/framework/data_service/proxy/core.rb index 5462e12297..27a517a148 100644 --- a/lib/metasploit/framework/data_service/proxy/core.rb +++ b/lib/metasploit/framework/data_service/proxy/core.rb @@ -118,6 +118,8 @@ class DataProxy def log_error(exception, ui_message) elog "#{ui_message}: #{exception.message}" exception.backtrace.each { |line| elog "#{line}" } + # TODO: We should try to surface the original exception, instead of just a generic one. + # This should not display the full backtrace, only the message. raise Exception, "#{ui_message}: #{exception.message}. See log for more details." end diff --git a/lib/metasploit/framework/data_service/proxy/nmap_data_proxy.rb b/lib/metasploit/framework/data_service/proxy/nmap_data_proxy.rb index a174aab42a..23f47aa171 100644 --- a/lib/metasploit/framework/data_service/proxy/nmap_data_proxy.rb +++ b/lib/metasploit/framework/data_service/proxy/nmap_data_proxy.rb @@ -5,7 +5,7 @@ module NmapDataProxy data_service = self.get_data_service() data_service.import_nmap_xml_file(args) rescue Exception => e - self.log_error(e, "Problem importing nmap XML file") + self.log_error(e, "Problem importing Nmap XML file") end end end \ No newline at end of file diff --git a/lib/metasploit/framework/data_service/proxy/vuln_data_proxy.rb b/lib/metasploit/framework/data_service/proxy/vuln_data_proxy.rb index 9d982f0106..e2f70a181c 100644 --- a/lib/metasploit/framework/data_service/proxy/vuln_data_proxy.rb +++ b/lib/metasploit/framework/data_service/proxy/vuln_data_proxy.rb @@ -5,7 +5,7 @@ module VulnDataProxy data_service = self.get_data_service() data_service.report_vuln(opts) rescue Exception => e - self.log_error(e, "Problem ") + self.log_error(e, "Problem reporting vuln") end end