mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 09:20:10 +00:00
Reworks REST API to return i18n success/error messages
Implements #4300
This commit is contained in:
parent
398e25c022
commit
16db3cda67
34 changed files with 175 additions and 171 deletions
|
|
@ -23,7 +23,7 @@ local rest_utils = require("rest_utils")
|
|||
|
||||
sendHTTPHeader('application/json')
|
||||
|
||||
local rc = rest_utils.consts_ok
|
||||
local rc = rest_utils.consts.success.ok
|
||||
local res = {}
|
||||
|
||||
local ifid = _GET["ifid"]
|
||||
|
|
@ -37,7 +37,7 @@ local ts_aggregation = _GET["ts_aggregation"]
|
|||
local no_fill = tonumber(_GET["no_fill"])
|
||||
|
||||
if isEmptyString(ifid) then
|
||||
rc = rest_utils.consts_invalid_interface
|
||||
rc = rest_utils.consts.err.invalid_interface
|
||||
print(rest_utils.rc(rc))
|
||||
return
|
||||
end
|
||||
|
|
@ -141,7 +141,7 @@ if res == nil then
|
|||
res["error"] = ts_utils.getLastErrorMessage()
|
||||
end
|
||||
|
||||
rc = rest_utils.consts_internal_error
|
||||
rc = rest_utils.consts.err.internal_error
|
||||
print(rest_utils.rc(rc, res))
|
||||
return
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue