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 e4f616b  fix(etcd): check res.body.error before accessing the data 
(#4371)
e4f616b is described below

commit e4f616be07b698f31fa47aabbce705129c86322b
Author: 罗泽轩 <[email protected]>
AuthorDate: Fri Jun 4 10:02:59 2021 +0800

    fix(etcd): check res.body.error before accessing the data (#4371)
    
    Signed-off-by: spacewander <[email protected]>
---
 apisix/core/etcd.lua | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/apisix/core/etcd.lua b/apisix/core/etcd.lua
index 50c13cc..e5f2b7b 100644
--- a/apisix/core/etcd.lua
+++ b/apisix/core/etcd.lua
@@ -104,6 +104,11 @@ function _M.get_format(res, real_key, is_dir, formatter)
         return nil, "etcd forbidden code: 403"
     end
 
+    if res.body.error then
+        -- other errors, like "grpc: received message larger than max"
+        return nil, res.body.error
+    end
+
     res.headers["X-Etcd-Index"] = res.body.header.revision
 
     if not res.body.kvs then

Reply via email to