1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +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,6 +1,7 @@
local http = require "http"
local geoip = require "geoip"
local io = require "io"
local oops = require "oops"
local stdnse = require "stdnse"
local table = require "table"
local url = require "url"
@@ -167,21 +168,14 @@ postrule = function()
end
action = function()
local output = stdnse.output_table()
-- Parse and sanity check the command line arguments.
local status, params, options = parse_args()
local status, params, options = oops.raise(
"Script argument problem",
parse_args())
if not status then
output.ERROR = params
return output, output.ERROR
return params
end
-- Render the map.
local status, msg = render(params, options)
if not status then
output.ERROR = msg
return output, output.ERROR
end
return output, stdnse.format_output(true, msg)
return oops.output(render(params, options))
end