You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by to...@apache.org on 2021/07/02 06:06:40 UTC

[apisix] branch master updated: chore: also print error when json decode failed (#4518)

This is an automated email from the ASF dual-hosted git repository.

tokers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new e35ef6d  chore: also print error when json decode failed (#4518)
e35ef6d is described below

commit e35ef6d54469a312b209bf60b194eca50938ebbe
Author: Shuyang Wu <wo...@gmail.com>
AuthorDate: Fri Jul 2 02:06:31 2021 -0400

    chore: also print error when json decode failed (#4518)
    
    Signed-off-by: yiyiyimu <wo...@gmail.com>
---
 apisix/admin/init.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apisix/admin/init.lua b/apisix/admin/init.lua
index 223b091..69e295f 100644
--- a/apisix/admin/init.lua
+++ b/apisix/admin/init.lua
@@ -158,7 +158,7 @@ local function run()
         local data, err = core.json.decode(req_body)
         if not data then
             core.log.error("invalid request body: ", req_body, " err: ", err)
-            core.response.exit(400, {error_msg = "invalid request body",
+            core.response.exit(400, {error_msg = "invalid request body: " .. err,
                                      req_body = req_body})
         end
 
@@ -228,7 +228,7 @@ local function run_stream()
         local data, err = core.json.decode(req_body)
         if not data then
             core.log.error("invalid request body: ", req_body, " err: ", err)
-            core.response.exit(400, {error_msg = "invalid request body",
+            core.response.exit(400, {error_msg = "invalid request body: " .. err,
                                      req_body = req_body})
         end