File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ function _M.get_json_request_body_table()
343343
344344 local body_tab , err = json .decode (body )
345345 if not body_tab then
346- return nil , { message = " could not parse JSON request body: " .. err }
346+ return nil , { message = " could not parse JSON request body: " .. ( err or " invalid JSON " ) }
347347 end
348348
349349 return body_tab
Original file line number Diff line number Diff line change 6767local function get_request_body_table ()
6868 local body , err = core .request .get_body ()
6969 if not body then
70- return nil , { message = " could not get body: " .. err }
70+ return nil , { message = " could not get body: " .. ( err or " request body is empty " ) }
7171 end
7272
7373 local body_tab , err = core .json .decode (body )
7474 if not body_tab then
75- return nil , { message = " could not parse JSON request body: " .. err }
75+ return nil , { message = " could not parse JSON request body: " .. ( err or " invalid JSON " ) }
7676 end
7777
7878 return body_tab
Original file line number Diff line number Diff line change 9393local function get_request_body_table ()
9494 local body , err = core .request .get_body ()
9595 if not body then
96- return nil , { message = " could not get body: " .. err }
96+ return nil , { message = " could not get body: " .. ( err or " request body is empty " ) }
9797 end
9898
9999 local body_tab , err = core .json .decode (body )
100100 if not body_tab then
101- return nil , { message = " could not parse JSON request body: " .. err }
101+ return nil , { message = " could not parse JSON request body: " .. ( err or " invalid JSON " ) }
102102 end
103103
104104 return body_tab
You can’t perform that action at this time.
0 commit comments