1.4.5.2
This commit is contained in:
14
EdgeUser/internal/errors/utils.go
Normal file
14
EdgeUser/internal/errors/utils.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package errors
|
||||
|
||||
import "strings"
|
||||
|
||||
// IsResourceNotFound 判断是否为资源无法查看错误
|
||||
func IsResourceNotFound(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
if strings.Contains(err.Error(), "resource not found") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user