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 }