You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/05/24 23:46:02 UTC

[GitHub] [servicecomb-mesher] tianxiaoliang commented on a change in pull request #118: 修改mesher适配最新的go-chassis

tianxiaoliang commented on a change in pull request #118:
URL: https://github.com/apache/servicecomb-mesher/pull/118#discussion_r429687181



##########
File path: proxy/resource/v1/status.go
##########
@@ -34,10 +35,16 @@ type StatusResource struct{}
 func (a *StatusResource) Health(context *restful.Context) {
 	healthResp := health.GetMesherHealth()
 	if healthResp.Status == health.Red {
-		context.WriteHeaderAndJSON(http.StatusInternalServerError, healthResp, common.JSON)
+		err := context.WriteHeaderAndJSON(http.StatusInternalServerError, healthResp, common.JSON)
+		if err != nil {
+			openlogging.GetLogger().Errorf("Write HeaderAndJSON error %s: ", err.Error())
+		}
 		return
 	}
-	context.WriteHeaderAndJSON(http.StatusOK, healthResp, common.JSON)
+	err := context.WriteHeaderAndJSON(http.StatusOK, healthResp, common.JSON)
+	if err != nil {
+		openlogging.GetLogger().Errorf("Write HeaderAndJSON error %s: ", err.Error())

Review comment:
       不要调用以f为结尾的方法了,都改成Error,Info这样,里面用fmt包

##########
File path: proxy/server/server.go
##########
@@ -64,7 +64,10 @@ func Run() {
 		panic(err)
 	}
 	profile()
-	chassis.Run()
+	if err := chassis.Run(); err != nil {
+		openlogging.Error("Chassis failed: " + err.Error())

Review comment:
       这里直接调用fatal,删掉panic




----------------------------------------------------------------
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:
users@infra.apache.org