You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ntool-biz/core/nstatus/check.go

25 lines
517 B
Go

package nstatus
import (
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
)
// IsNotFound 判断错误是否属于NotFound
func IsNotFound(err error) bool {
nErr := ConvertErr(err)
if nErr == nil {
return false
}
return nErr.Code == code.StatusNotFound
}
// IsDatabaseErr 判断错误是否属于数据库错误
func IsDatabaseErr(err error) bool {
nErr := ConvertErr(err)
if nErr == nil {
return false
}
return nErr.Msg == msg.DatabaseError
}