优化错误日志处理

This commit is contained in:
GoEdgeLab
2023-08-13 14:25:59 +08:00
parent c42f064edc
commit 35fdab0d66
3 changed files with 13 additions and 5 deletions

View File

@@ -50,7 +50,11 @@ func (this *APIStream) Start() {
}
err := this.loop()
if err != nil {
remotelogs.Warn("API_STREAM", err.Error())
if rpc.IsConnError(err) {
remotelogs.Debug("API_STREAM", err.Error())
} else {
remotelogs.Warn("API_STREAM", err.Error())
}
time.Sleep(10 * time.Second)
continue
}
@@ -76,7 +80,7 @@ func (this *APIStream) loop() error {
if this.isQuiting {
return nil
}
return errors.Wrap(err)
return err
}
this.stream = nodeStream
@@ -92,7 +96,7 @@ func (this *APIStream) loop() error {
remotelogs.Println("API_STREAM", "quit")
return nil
}
return errors.Wrap(err)
return err
}
// 处理消息