mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-16 06:37:34 +00:00
httpError remplace by logError
This commit is contained in:
parent
5c66279748
commit
8e2d314fc9
|
@ -1,12 +1,3 @@
|
||||||
//
|
|
||||||
// Functions
|
|
||||||
//
|
|
||||||
|
|
||||||
function gmInte.httpError(error)
|
|
||||||
gmInte.log("Web request failed")
|
|
||||||
gmInte.log("Error details: "..error)
|
|
||||||
end
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// HTTP
|
// HTTP
|
||||||
//
|
//
|
||||||
|
@ -32,10 +23,12 @@ local function sendHTTP(params)
|
||||||
if (string.sub(code, 1, 1) == "2") then
|
if (string.sub(code, 1, 1) == "2") then
|
||||||
params.success && params.success(body, code, headers)
|
params.success && params.success(body, code, headers)
|
||||||
else
|
else
|
||||||
gmInte.httpError(body)
|
gmInte.logError("HTTP Request failed with code " .. code .. " and body " .. body)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
failed = gmInte.httpError,
|
failed = function(error)
|
||||||
|
gmInte.httpError(error)
|
||||||
|
end
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user