This commit is contained in:
aozhiwei 2021-08-12 15:55:53 +08:00
parent 73e720ae91
commit 99e7d0f59b

View File

@ -85,6 +85,10 @@ func (this *HttpServer) dispatchRequest(c *Context) {
atomic.CompareAndSwapInt64(&this.maxHandleTime, oldVal, endTick - beginTick)
}
atomic.AddInt64(&this.okTimes, 1)
if err := recover(); err != nil {
SysLog().Error("handle name:%s error:%s", handleName, err)
c.Response(`{"errcode":500, "errmsg":"服务器内部错误"}`)
}
}()
handle(c)
} else {