parent
eb07dba9bd
commit
053a625cb5
@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
Loading…
Reference in New Issue