Skip to content

Commit 9d94543

Browse files
committed
feat: Determine if custom handle is nil
1 parent a6403a8 commit 9d94543

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

error_handle.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ func ErrorHandle(logger *zap.Logger, customHandle func(c *gin.Context, err error
5858
return
5959
}
6060
// 自定义处理函数,一般用于业务错误
61-
if customHandle(c, err) {
62-
return
61+
if customHandle != nil {
62+
if customHandle(c, err) {
63+
return
64+
}
6365
}
6466

6567
requestID := uuid.New()

0 commit comments

Comments
 (0)