tokers commented on a change in pull request #2346:
URL: https://github.com/apache/apisix/pull/2346#discussion_r497224277



##########
File path: bin/apisix
##########
@@ -998,19 +998,19 @@ local function init_etcd(show_output)
         local errmsg = string.format("got malformed version message: \"%s\" 
from etcd", res)
         local body, _, err = dkjson.decode(res)
         if err then
-            io.stderr:write(errmsg)
+            error(errmsg)
             return
         end
 
         local cluster_version = body["etcdcluster"]
         if not cluster_version then
-            io.stderr:write(errmsg)
+            error(errmsg)
             return
         end
 
         if compare_semantic_version(cluster_version, min_etcd_version) then
-            io.stderr:write("etcd cluster version ", cluster_version,

Review comment:
       I think it's strange here to use `error` since it exposes the coroutine 
stack traceback besides the error message, which is useless for administrator. 
Since it's not a programming fault or some systematical errors, i think output 
error message to stderr is better.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to