mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 16:24:25 +08:00
code refactor
This commit is contained in:
@@ -20,12 +20,12 @@ var (
|
||||
)
|
||||
|
||||
// Recovery logs error message when error occurs
|
||||
func Recovery(c *core.Context) {
|
||||
func Recovery(c *core.WebContext) {
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
stack := stack(3)
|
||||
|
||||
log.ErrorfWithRequestIdAndExtra(c, string(stack), "System Error! because %s", err)
|
||||
log.ErrorfWithExtra(c, string(stack), "System Error! because %s", err)
|
||||
utils.PrintJsonErrorResult(c, errs.ErrSystemError)
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user