Skip to content

Commit 0257070

Browse files
committed
修复IsNotFoundError当error为nil
1 parent f943aed commit 0257070

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

exception/exception.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ func NewInternalServerError(format string, a ...interface{}) APIException {
7070

7171
// IsNotFoundError 判断是否是NotFoundError
7272
func IsNotFoundError(err error) bool {
73+
if err == nil {
74+
return false
75+
}
76+
7377
e, ok := err.(APIException)
7478
if !ok {
7579
return false

0 commit comments

Comments
 (0)