alist/internal/errs/object.go

18 lines
310 B
Go
Raw Normal View History

2022-06-23 16:09:22 +08:00
package errs
import (
"errors"
2022-08-03 14:26:59 +08:00
2022-06-23 16:09:22 +08:00
pkgerr "github.com/pkg/errors"
)
var (
ObjectNotFound = errors.New("object not found")
NotFolder = errors.New("not a folder")
NotFile = errors.New("not a file")
)
func IsObjectNotFound(err error) bool {
2022-06-25 20:38:02 +08:00
return errors.Is(pkgerr.Cause(err), ObjectNotFound)
2022-06-23 16:09:22 +08:00
}