1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 20:29:03 +00:00

Consolidate some error handling, standardize geoip coordinates, fix output bugs. Fixes #1744

This commit is contained in:
dmiller
2019-09-20 04:40:20 +00:00
parent 634fc19089
commit 3c24eda4be
7 changed files with 138 additions and 89 deletions

View File

@@ -1,5 +1,6 @@
local geoip = require "geoip"
local io = require "io"
local oops = require "oops"
local stdnse = require "stdnse"
local table = require "table"
@@ -76,21 +77,14 @@ postrule = function()
end
action = function()
local output = stdnse.output_table()
-- Parse and sanity check the command line arguments.
local status, path = parse_args()
local status, path = oops.raise(
"Script argument problem",
parse_args())
if not status then
output.ERROR = path
return output, output.ERROR
return path
end
-- Render the map.
local status, msg = render(path)
if not status then
output.ERROR = msg
return output, output.ERROR
end
return msg
return oops.output(render(path))
end