[DEV] fatal to error when user function is panic

This commit is contained in:
bryan 2025-05-29 17:56:39 +08:00
parent d545612482
commit 2daa1f791c

View File

@ -51,10 +51,10 @@ func (c *Context) TryRecover() {
t := reflect.TypeOf(err)
switch t.Kind() {
case reflect.String:
log.Fatalf("panic err:%v. Panic stack:\n%s", err, stack)
log.Errorf("panic err:%v. Panic stack:\n%s", err, stack)
c.RESULT_ERROR(apicfg.ErrCodeUnknownError, "unknown error")
default:
log.Fatalf("panic err type: %s:%s. Panic stack:\n%s", t.Name(), t.String(), stack)
log.Errorf("panic err type: %s:%s. Panic stack:\n%s", t.Name(), t.String(), stack)
c.RESULT_ERROR(apicfg.ErrCodeUnknownError, "unknown error")
}
}