liquid_feedback_frontend
view env/util/api_error.lua @ 1429:2305d3cb16da
Fixed wrong variable name2
author | bsw |
---|---|
date | Fri Oct 05 21:57:26 2018 +0200 (2018-10-05) |
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