mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-04 04:57:35 +08:00
fix(etcd): check res.body.error before accessing the data (#4371)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
This commit is contained in:
parent
c61261af8d
commit
e4f616be07
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user