1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Show a nicer error message in Ndiff when an input file can't be opened.

This commit is contained in:
david
2010-01-25 23:07:16 +00:00
parent 9365ad46e9
commit 3c09069ee4
2 changed files with 11 additions and 4 deletions

View File

@@ -1,5 +1,8 @@
# 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
would cause the error
http-favicon.nse:141: variable 'dirname' is not declared

View File

@@ -1193,10 +1193,14 @@ def main():
filename_a = input_filenames[0]
filename_b = input_filenames[1]
scan_a = Scan()
scan_a.load_from_file(filename_a)
scan_b = Scan()
scan_b.load_from_file(filename_b)
try:
scan_a = Scan()
scan_a.load_from_file(filename_a)
scan_b = Scan()
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)