# HG changeset patch # User Kim Alvefur # Date 1580513890 -3600 # Node ID e5d08bb58155c876186a77ffe1d3f4d233e5f64b # Parent 3261a82884bba1b12070b8da6293a5dd640446e0 mod_rest: Map the error@by attribute diff -r 3261a82884bb -r e5d08bb58155 mod_rest/jsonmap.lib.lua --- a/mod_rest/jsonmap.lib.lua Wed Jan 29 21:44:00 2020 +0100 +++ b/mod_rest/jsonmap.lib.lua Sat Feb 01 00:38:10 2020 +0100 @@ -203,11 +203,13 @@ end if t.type == "error" then + local error = s:get_child("error"); local err_typ, err_condition, err_text = s:get_error(); t.error = { type = err_typ, condition = err_condition, - text = err_text + text = err_text, + by = error.attr.by, }; return t; end @@ -281,7 +283,7 @@ end if type(t.error) == "table" then - return st.error_reply(st.reply(s), str(t.error.type), str(t.error.condition), str(t.error.text)); + return st.error_reply(st.reply(s), str(t.error.type), str(t.error.condition), str(t.error.text), str(t.error.by)); elseif t.type == "error" then s:text_tag("error", t.body, { code = t.error_code and tostring(t.error_code) }); return s;