alist/internal/errs/object.go

18 lines
310 B
Go
Raw Normal View History

2022-06-23 08:09:22 +00:00
package errs
import (
"errors"
2022-08-03 06:26:59 +00:00
2022-06-23 08:09:22 +00: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 12:38:02 +00:00
return errors.Is(pkgerr.Cause(err), ObjectNotFound)
2022-06-23 08:09:22 +00:00
}