liquid_feedback_frontend
view env/util/api_error.lua @ 1450:2fbf95bee380
Fixed missing closing end
author | bsw |
---|---|
date | Thu Oct 18 17:17:32 2018 +0200 (2018-10-18) |
parents | 32cc544d5a5b |
children |
line source
1 function util.api_error(status_code, status_text, error_code, error_description)
2 slot.set_layout(nil, "application/json")
3 request.set_status(status_code, status_text)
4 if status_code == 401 then
5 request.add_header("WWW-Authenticate", "Bearer error=\"" .. error_code .. "\", error_description=\"" .. error_description .. "\"")
6 end
7 slot.put_into("data", json.export(json.object{
8 error = error_code,
9 error_description = error_description
10 }))
11 return false
12 end