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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user