Finish half translation work.

This commit is contained in:
zicla
2019-05-04 23:36:05 +08:00
parent 900924d196
commit 5625149766
52 changed files with 613 additions and 950 deletions

View File

@ -1,18 +1,18 @@
package core
//带有panic恢复的方法
//run a method with panic recovery.
func RunWithRecovery(f func()) {
defer func() {
if err := recover(); err != nil {
LOGGER.Error("异步任务错误: %v", err)
LOGGER.Error("error in async method: %v", err)
}
}()
//执行函数
//execute the method
f()
}
//处理错误的统一方法 可以省去if err!=nil 这段代码
//shortcut for panic check
func PanicError(err error) {
if err != nil {
panic(err)