mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
Show a nicer error message in Ndiff when an input file can't be opened.
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
# Nmap Changelog ($Id$); -*-text-*-
|
# Nmap Changelog ($Id$); -*-text-*-
|
||||||
|
|
||||||
|
o [Ndiff] Show a nicer error message when an input file can't be
|
||||||
|
loaded. Suggested by Derril Lucci, who also contributed a patch.
|
||||||
|
|
||||||
o Added a function that was missing from http-favicon.nse. Its absence
|
o Added a function that was missing from http-favicon.nse. Its absence
|
||||||
would cause the error
|
would cause the error
|
||||||
http-favicon.nse:141: variable 'dirname' is not declared
|
http-favicon.nse:141: variable 'dirname' is not declared
|
||||||
|
|||||||
@@ -1193,10 +1193,14 @@ def main():
|
|||||||
filename_a = input_filenames[0]
|
filename_a = input_filenames[0]
|
||||||
filename_b = input_filenames[1]
|
filename_b = input_filenames[1]
|
||||||
|
|
||||||
|
try:
|
||||||
scan_a = Scan()
|
scan_a = Scan()
|
||||||
scan_a.load_from_file(filename_a)
|
scan_a.load_from_file(filename_a)
|
||||||
scan_b = Scan()
|
scan_b = Scan()
|
||||||
scan_b.load_from_file(filename_b)
|
scan_b.load_from_file(filename_b)
|
||||||
|
except Exception, e:
|
||||||
|
print >> sys.stderr, u"Can't open file: %s" % str(e)
|
||||||
|
sys.exit(EXIT_ERROR)
|
||||||
|
|
||||||
diff = ScanDiff(scan_a, scan_b)
|
diff = ScanDiff(scan_a, scan_b)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user