优化错误提示

This commit is contained in:
GoEdgeLab
2021-11-10 21:51:56 +08:00
parent 940517e660
commit 3dd47acb75
15 changed files with 112 additions and 31 deletions

View File

@@ -93,6 +93,18 @@ func Error(tag string, description string) {
}
}
// ErrorObject 打印错误对象
func ErrorObject(tag string, err error) {
if err == nil {
return
}
if rpc.IsConnError(err) {
Warn(tag, err.Error())
} else {
Error(tag, err.Error())
}
}
// ServerError 打印服务相关错误信息
func ServerError(serverId int64, tag string, description string) {
logs.Println("[" + tag + "]" + description)